output_description: For each insert operation, print the number of elements in $S$.  
  For each find operation, print the number of specified elements in $S$.  
  For each dump operation, print the corresponding elements in ascending order.
  Print an element in a line.
input_description: The input is given in the following format.
  
      
      
      $q$
      $query_1$
      $query_2$
      :
      $query_q$
      
  
  Each query $query_i$ is given by
  
      
      
      0 $x$
      
  
  or
  
      
      
      1 $x$
      
  
  or
  
      
      
      2 $x$
      
  
  or
  
      
      
      3 $L$ $R$
      
  
  where the first digits 0, 1, 2 and 3 represent insert, find, delete and dump
  operations respectively.
attempt: def binary(l, c):
      fst = 0
      last = len(l)
      mid = int(last / 2)
      if fst == 0 and last == 0:
          l.insert(0, c)
          return
      while fst < last:
          mid = int((fst + last) / 2)
          if last == mid:
              break
          elif fst == mid:
              break
          elif l[mid] >= c:
              last = mid
          elif l[mid] <= c:
              fst = mid
      if l[mid] < c:
          mid += 1
      l.insert(mid, c)
  
  
  q = int(input())
  S = []
  a = []
  for i in range(q):
      a.append(list(map(int, input().split())))
  
  for i in range(q):
      if a[i][0] == 0:
          binary(S, a[i][1])
          print(len(S))
      elif a[i][0] == 1:
          if a[i][1] in S:
              print(1)
          else:
              print(0)
      elif a[i][0] == 2:
          if a[i][1] in S:
              S.remove(a[i][1])
      else:
          for b in range(len(S)):
              if S[b] >= a[i][1]:
                  for c in range(b, len(S)):
                      if S[c] <= a[i][2]:
                          print(S[c])
                      else:
                          break
                  break
  
problem_description: Multi-Set
  
  For a set $S$ of integers, perform a sequence of the following operations.
  Note that _multiple elements can have equivalent values in $S$_.
  
    * insert($x$): Insert $x$ to $S$ and report the number of elements in $S$ after the operation.
    * find($x$): Report the number of $x$ in $S$.
    * delete($x$): Delete all $x$ from $S$.
    * dump($L$, $R$): Print elements $x$ in $S$ such that $L \leq x \leq R$.
samples: [{"input": "10\n    0 1\n    0 1\n    0 2\n    0 3\n    2 2\n    1 1\n    1 2\n    1 3\n    0 4\n    3 1 4", "output": "1\n    2\n    3\n    4\n    2\n    0\n    1\n    4\n    1\n    1\n    3\n    4"}]