class SegmentTree
  def initialize
    @N=2**17
    @INF=2**31-1
    @seg=Array.new(2*@N-1){@INF}
  end
  
  def update(i, x)
    i+=@N-1 #??°??????i??????????????????????????¨????????????????????????
    @seg[i]=x
    while i.nonzero?
      i=(i-1)/2 #????????????????????????????????¨????????????
      @seg[i]=[@seg[2*i+1], @seg[2*i+2]].min #????????????
    end
  end
  
  def segmin(a, b, i=0, l=0, r=@N) #??????i?????????????????????=>[l, r)
    if b<=l or r<=a #2??????????????????????????????; ??\???????????????????????´
      @INF
    elsif a<=l and r<=b #????????????????????¨?????\??????????????????????????????
      @seg[i]
    else
      m=(l+r)/2
      vl=segmin(a, b, 2*i+1, l, m) #?????????
      vr=segmin(a, b, 2*i+2, m, r) #?????????
      [vl, vr].min
    end
  end
end


n, q=gets.split.map(&:to_i)

st=SegmentTree.new
q.times do |i|
  c, a, b=gets.split.map(&:to_i)
  case c
  when 0 #update a-th element to b
    st.update(a, b)
  when 1 #getmin [a..b]
    puts st.segmin(a, b+1)
  end
end