class Seg
  def initialize ( n, init, &func)
    @tree = Array.new( 2**n - 1, init )
    @init = init
    @n    = n
    @func = func || lambda{|x,y| x < y}
  end

  def update (i, x)
    i = 2**(@n-1) - 1 + i
    @tree[i] = x

    while (i=parent(i))>=0
      a,b = @tree[i], x
      @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
    end

  end

  def find ( s, t, k=0, i=0, j=@n-1 )
    return @init if t<i || j<s
    return @tree[k] if s<=i && j<=t

    a, b = kids(k)
    a, b = find(s, t, a, i, (i+j)/2), find(s, t, b, (i+j)/2+1, j)
    @func.call(a, b) ? a : b
  end

  private
  def parent(i)
    (i-1)/2
  end

  def kids(i)
    [2*i+1, 2*i+2]
  end
end

n, q = gets.split.map(&:to_i)
seg  = Seg.new(n, 2**31-1) { |x,y| x < y }
q.times do
  com, x, y = gets.split.map(&:to_i)

  case com
  when 0
    seg.update(x, y)
  when 1
    puts seg.find(x,y)
  end
end