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

a = Array.new
n.times{|i| a[i] = 2 ** 31 - 1}

q.times{
    query, x, y = gets.split.map(&:to_i)

    case query
    when 0 # update
        a[x] = y
    when 1 # find
        min = a[x]
        for i in x..y
            if min > a[i]
                min = a[i]
            end
        end
        puts min
    end
}

