input: Write a function to calculate the percentage of transcripts mapping to rRNA from an HTseq counts file and a GTF file. The function should take two arguments: a path to an HTseq counts file and a path to a GTF file. It should extract all identifiers of genes/transcripts mapping to rRNA and MT genes, count reads matching these identifiers, and write the output to a file named "HTseq_counts_file_rRNAmtRNACounts.txt". If either file does not exist, the function should print an error message and exit. The function should return the percentage of rRNA mapped reads and the path of the output file.
  
  def calculate_rrna_percentage(htseq_counts_path, gtf_path):
      # Function implementation goes here
      pass
  
  assert calculate_rrna_percentage("/path/to/HTseq_counts.txt", "/path/to/GTF_file.gtf") == (15.3, "/path/to/HTseq_counts_rRNAmtRNACounts.txt")
  assert calculate_rrna_percentage("/nonexistent_file.txt", "/path/to/GTF_file.gtf") == None # Assuming it will print an error and exit
  assert calculate_rrna_percentage("/path/to/HTseq_counts.txt", "/nonexistent_file.gtf") == None # Assuming it will print an error and exit
  assert calculate_rrna_percentage("/path/to/empty_file.txt", "/path/to/GTF_file.gtf") == (0.0, "/path/to/empty_file_rRNAmtRNACounts.txt") # Assuming an empty file results in 0% rRNA
output: def calculate_rrna_percentage(htseq_counts_path, gtf_path):
      import os
      if not os.path.exists(htseq_counts_path) or not os.path.exists(gtf_path):
          print("Error: One or both of the files do not exist.")
          return None
      
      rrna_mt_ids = set()
      with open(gtf_path, 'r') as gtf_file:
          for line in gtf_file:
              if line.startswith('#'):
                  continue
              fields = line.strip().split('\t')
              if fields[2] == 'gene':
                  attributes = fields[8].split(';')
                  for attr in attributes:
                      if 'gene_biotype "rRNA"' in attr or 'gene_biotype "Mt_rRNA"' in attr:
                          gene_id = attr.split('"')[1]
                          rrna_mt_ids.add(gene_id)
                          break
      
      total_reads = 0
      rrna_mt_reads = 0
      output_file_path = htseq_counts_path.replace('.txt', '_rRNAmtRNACounts.txt')
      
      with open(htseq_counts_path, 'r') as htseq_file, open(output_file_path, 'w') as output_file:
          for line in htseq_file:
              if line.startswith('__'):
                  continue
              gene_id, count = line.strip().split('\t')
              count = int(count)
              total_reads += count
              if gene_id in rrna_mt_ids:
                  rrna_mt_reads += count
                  output_file.write(f"{gene_id}\t{count}\n")
      
      if total_reads == 0:
          percentage = 0.0
      else:
          percentage = (rrna_mt_reads / total_reads) * 100
      
      return percentage, output_file_path