output_description: For each find operation, print the minimum element.
input_description: n q
      com0 x0 y0
      com1 x1 y1
      ...
      comq−1 xq−1 yq−1
      
  
  In the first line, n (the number of elements in A) and q (the number of
  queries) are given. Then, q queries are given where com represents the type of
  queries. '0' denotes update(xi, yi) and '1' denotes find(xi, yi).
attempt: # https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_2_A
  import sys
  
  input = sys.stdin.readline
  
  n, q = map(int, input().split())
  
  
  class RMQ:
      def __init__(self, n, e):
          # 単位元
          self.e = e
          # num_min:n以上の最小の2のべき乗
          self.num_min = 2 ** (n - 1).bit_length()
          self.seg_min = [self.e] * 2 * self.num_min
  
      def init_min(self, init_min_val):
          # 初期値が指定されている場合
          # set_val
          for i in range(n):
              self.seg_min[i + self.num_min - 1] = init_min_val[i]
          # built
          for i in range(self.num_min - 2, -1, -1):
              self.seg_min[i] = min(self.seg_min[2 * i + 1], self.seg_min[2 * i + 2])
  
      def update_min(self, k, x):
          k += self.num_min - 1
          self.seg_min[k] = x
          while k:
              k = (k - 1) // 2
              self.seg_min[k] = min(self.seg_min[k * 2 + 1], self.seg_min[k * 2 + 2])
  
      def query_min(self, p, q):
          q += 1
          if q <= p:
              return self.e
          p += self.num_min - 1
          q += self.num_min - 2
          res = self.e
          while q - p > 1:
              if p & 1 == 0:
                  res = min(res, self.seg_min[p])
              if q & 1 == 1:
                  res = min(res, self.seg_min[q])
                  q -= 1
              p = p // 2
              q = (q - 1) // 2
          if p == q:
              res = min(res, self.seg_min[p])
          else:
              res = min(min(res, self.seg_min[p]), self.seg_min[q])
          return res
  
  
  e = (2**31) - 1
  rmq = RMQ(n, e)
  
  for i in range(q):
      com, x, y = map(int, input().split())
      if com == 0:
          rmq.update_min(x, y)
      else:
          ans = rmq.query_min(x, y)
          print(ans)
  
problem_description: Range Minimum Query (RMQ)
  
  Write a program which manipulates a sequence A = {a0, a1, . . . , an-1} with
  the following operations:
  
    * find(s, t): report the minimum element in as, as+1, . . . ,at.
    * update(i, x): change ai to x.
  
  Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.
samples: [{"input": "3 5\n    0 0 1\n    0 1 2\n    0 2 3\n    1 0 2\n    1 1 2", "output": "1\n    2"}, {"input": "1 3\n    1 0 0\n    0 0 5\n    1 0 0", "output": "2147483647\n    5"}]