input: Write a python function to add numbers to a MedianSequence and remove the median, ensuring the sequence is correctly maintained.
  assert len(seq:=MedianSequence()) == 0
  seq.add(1)
  seq.add(3)
  seq.add(2)
  assert len(seq) == 3
  seq.remove_median()
  assert len(seq) == 2
  assert seq.nums == [1, 3]
  seq.remove_median()
  assert len(seq) == 1
  assert seq.nums == [1]
output: import bisect
  
  class MedianSequence:
      def __init__(self):
          self.nums = []
  
      def __len__(self):
          return len(self.nums)
  
      def add(self, number):
          bisect.insort(self.nums, number)
  
      def remove_median(self):
          n = len(self.nums)
          if n == 0:
              raise IndexError("remove_median from empty sequence")
          median_index = (n - 1) // 2
          self.nums.pop(median_index)