class SegmentTreeBase
  def initialize(arr, l = 0, r = arr.size - 1)
    @l, @r = l, r
    if @l == @r
      @agg = arr[l]
    else
      c = (l + r) / 2
      @left_child = self.class.new(arr, l, c)
      @right_child = self.class.new(arr, c + 1, r)
      @agg = aggregation_of(@left_child.agg, @right_child.agg)
    end
  end

  attr_reader :agg, :l, :r

  def update(i, x)
    if @l == @r
      update_single(x)
    else
      (i <= @left_child.r ? @left_child : @right_child).update(i, x)
      @agg = aggregation_of(@left_child.agg, @right_child.agg)
    end
  end

  def query(l, r)
    return @agg if l == @l && r == @r
    return @left_child.query(l, r) if r <= @left_child.r
    return @right_child.query(l, r) if @right_child.l <= l
    agg_left = @left_child.query(l, @left_child.r)
    agg_right = @right_child.query(@right_child.l, r)
    return aggregation_of(agg_left, agg_right)
  end
end

class SegmentTree < SegmentTreeBase
  def aggregation_of(x, y)
    [x, y].min
  end

  def update_single(x)
    @agg = x
  end
end

n, q = gets.split.map(&:to_i)
seg = SegmentTree.new(Array.new(n, 2 ** 31 - 1))
q.times do
  c, x, y = gets.split.map(&:to_i)
  if c == 0
    seg.update(x, y)
  else
    puts seg.query(x, y)
  end
end

