input: def merge_sort(A, B):
      """
      Sorts two large lists A and B by comparing their elements one by one. The algorithm starts by comparing the first element of list A with the first element of list B. If the element from A is greater, it adds it to the result list and moves the pointer of B to the next element. If the element from A is smaller, it moves the pointer of A to the next element. This process continues until one of the lists is completely traversed. The remaining elements of the other list are then appended to the result list.
      >>> merge_sort([3, 6, 8, 10, 11], [2, 5, 7, 12])
      [2, 3, 5, 6, 7, 8, 10, 11, 12]
      """
      result = []
      i, j = 0, 0
  
      # Compare elements and add the smaller one to the result
      while i < len(A) and j < len(B):
          if A[i] < B[j]:
              result.append(A[i])
              i += 1
          else:
              result.append(B[j])
              j += 1
  
      # Add remaining elements from A and B
      result += A[i:]
      result += B[j:]
  
      return result
output:     return result