output_description: For each get operation, print an integer 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 $key$ $x$
      
  
  or
  
      
      
      1 $key$
      
  
  or
  
      
      
      2 $key$
      
  
  where the first digits 0, 1 and 2 represent insert, get and delete operations
  respectively.
attempt: import bisect
  
  keys = []
  
  q = int(input())
  d = {}
  
  
  def find(x):
      index = bisect.bisect_left(keys, x)
      if index == len(keys):
          return -1
      if keys[index] == x:
          return index
      else:
          return -1
  
  
  for _ in range(q):
      query = input().split(" ")
      if query[0] == "0":
          if find(query[1]) != -1:
              pass
          else:
              bisect.insort_left(keys, query[1])
          d[query[1]] = query[2]
      elif query[0] == "1":
          if find(query[1]) != -1:
              print(d[query[1]])
          else:
              print(0)
      elif query[0] == "2":
          while find(query[1]) >= 0:
              keys.pop(find(query[1]))
  
problem_description: Map: Delete
  
  For a dictionary $M$ that stores elements formed by a pair of a string key and
  an integer value, perform a sequence of the following operations. Note that
  _each key in $M$ must be unique_.
  
    * insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$.
    * get($key$): Print the value with the specified $key$. _Print 0 if there is no such element_.
    * delete($key$): Delete the element with the specified $key$.
samples: [{"input": "8\n    0 blue 4\n    0 red 1\n    0 white 5\n    1 red\n    1 blue\n    2 red\n    1 black\n    1 red", "output": "1\n    4\n    0\n    0"}]