output_description: For each query of type 2, print a line containing the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      S
      Q
      Query_1
      \vdots
      Query_Q
      
  
  Here, Query_i in the 4-th through (Q+3)-th lines is one of the following:
  
      
      
      1 i_q c_q
      
      
      
      2 l_q r_q
attempt: import sys
  
  N, M, K = map(int, input().split())
  AB = [list(map(int, input().split())) for i in range(M)]
  CD = [list(map(int, input().split())) for i in range(K)]
  
  
  # xの木の根を求める
  def root(x, li):
      if li[x] == x:
          return x
      else:
          li[x] = root(li[x], li)
          return li[x]
  
  
  # xとyが同じ集合に属するかの判定
  def find(x, y, li):
      return root(x, li) == root(y, li)
  
  
  # xとｙを併合
  def union(x, y, li):
      x = root(x, li)
      y = root(y, li)
      if x == y:
          return
      else:
          li[x] = y
  
  
  li1 = [i for i in range(N)]
  li2 = [i for i in range(N)]
  
  for i in range(M):
      a = AB[i][0]
      b = AB[i][1]
      union(a - 1, b - 1, li1)
  # for i in range(K):
  #     c = CD[i][0]
  #     d = CD[i][1]
  #     union(c-1,d-1,li2)
  sys.exit()
  mm = [0 for i in range(max(li1))]
  for i in range(N):
      m = root(i, li1)
      mm[m - 1] += 1
  
  # print(li1)
  # print(mm)
  ans = [mm[li1[i] - 1] - 1 for i in range(N)]
  # print(ans)
  
  for i in range(M):
      a = AB[i][0]
      b = AB[i][1]
      ans[a - 1] -= 1
      ans[b - 1] -= 1
  
  
  for i in range(K):
      c = CD[i][0]
      d = CD[i][1]
      if find(c - 1, d - 1, li1):
          ans[c - 1] -= 1
          ans[d - 1] -= 1
  print(*ans)
  
problem_description: Statement
  
  You are given a string S of length N consisting of lowercase English letters.
  
  Process Q queries of the following two types:
  
    * Type 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.)
    * Type 2: answer the number of different characters occurring in the substring of S between the l_q-th and r_q-th characters (inclusive).
samples: [{"input": "7\n    abcdbbd\n    6\n    2 3 6\n    1 5 z\n    2 1 1\n    1 4 a\n    1 7 d\n    2 1 7", "output": "3\n    1\n    5\n    \n\nIn the first query, `cdbb` contains three kinds of letters: `b` , `c` , and\n`d`, so we print 3.\n\nIn the second query, S is modified to `abcdzbd`.\n\nIn the third query, `a` contains one kind of letter: `a`, so we print 1.\n\nIn the fourth query, S is modified to `abcazbd`.\n\nIn the fifth query, S does not change and is still `abcazbd`.\n\nIn the sixth query, `abcazbd` contains five kinds of letters: `a`, `b`, `c`,\n`d`, and `z`, so we print 5."}]