class Segtree<Monoid> constructor(n : Int ,ori : Monoid, m_fun : (Monoid,Monoid) -> Monoid){
    var dat : MutableList<Monoid>
    //評価関数
    var check : (Monoid,Monoid) -> Monoid = m_fun
    //単位元
    var origin = ori
    //領域
    var range : Int = 1

    //初期化処理、配列の長さを確定させて、モノイドで埋める
    init {
        range = 1
        while (range < n) range *= 2
        dat = MutableList(2*range,{origin})
    }

    fun update(place : Int,value : Monoid){
        var tmp = place + range - 1
        dat[tmp] = value
        while(tmp > 0){
            tmp = (tmp-1).shr(1)
            dat[tmp] = check(dat[2*tmp+1],dat[2*tmp+2])
        }
    }

    fun setValue(place : Int ,value : Monoid){
        dat[place + range - 1] = value
    }

    fun que(a : Int,b :Int,k :Int,l : Int,r : Int) : Monoid{
        if(r <= a || b <= l)return origin
        if(a <= l && r <= b)return dat[k]
        return check(que(a,b,2*k+1,l,(l+r)/2),que(a,b,2*k+2,(l+r)/2,r))
    }
    //fun quety(a : Int,b : Int) = que(a,Math.min(b,range),0,0,range)

    fun quety(a : Int,b : Int) : Monoid{
        var L = origin
        var R = origin
        var A = a + range - 1
        var B = b + range - 1
        while(A < B){
            if(A and 1 == 0)L = check(L,dat[A++])
            if(B and 1 == 0)R = check(R,dat[--B])
            A = A.shr(1)
            B = B.shr(1)
        }
        return check(L,R)
    }

    fun makeTree(){
        var TmpRange = range
        while(TmpRange > 1){
            for(i in 0 until TmpRange step 2){
                val tmp = i + TmpRange - 1
                dat[(tmp- 1).shr(1)] = check(dat[tmp],dat[tmp+1])
            }
            TmpRange = TmpRange.shr(1)
        }
    }
}

fun main(args : Array<String>){
    val (n,q) = readLine()!!.split(' ').map{ it.toInt() }
    val tree = Segtree(n,1L.shl(31)-1,{a : Long,b : Long -> Math.min(a,b)})
    for(i in 0 until n)tree.setValue(0,1L.shl(31)-1)
    tree.makeTree()
    for(i in 0 until q){
        val (a,b,c) = readLine()!!.split(' ').map{ it.toInt() }
        if(a == 0){
            tree.update(b,c.toLong())
        }
        else{
            println(tree.quety(b,c+1))
        }
    }
}
