import math



def update(index,n):

    targ[index] = n

    index = (index - 1) // 2

    while True:

        targ[index] = min(targ[index * 2 + 1],targ[index * 2 + 2])

        if index <= 0:

            break

        index = (index - 1) // 2



def find(i,e,node,inode,enode):

    #print(i,e,node,inode,enode)

    if inode > e or enode < i:

        return float("inf")

    elif (i <= inode and enode <= e) or inode==enode:

        return targ[node]



    else:

        irange = find(i,e,2*node + 1,inode,(inode+enode)// 2 )

        erange = find(i,e,2*node + 2,(inode+enode)//2 + 1,enode)

        return min(irange,erange)



num,query = (int(n) for n in input().split(' '))

initial = 2147483647

ln = 2 ** math.ceil(math.log2(num)) - 1

if num == 1:

    tail = 2

else:

    tail = 2 ** math.ceil(math.log2(num)) - num

global targ

targ = [initial] * (ln + num + tail)



for q in range(query):

    #print(targ)

    temp = [int(n) for n in input().split(' ') ]

    if temp[0] == 0:

        update(temp[1] + ln,temp[2])

    else:

        print((find(temp[1],temp[2],0,0,ln)))
import math

import sys

def update(index,n):

    targ[index] = n

    index = (index - 1) // 2

    while True:

        targ[index] = min(targ[index * 2 + 1],targ[index * 2 + 2])

        if index <= 0:

            break

        index = (index - 1) // 2



def find(i,e,node,inode,enode):

    #print(i,e,node,inode,enode)

    if inode > e or enode < i:

        return float("inf")

    elif (i <= inode and enode <= e) or inode==enode:

        return targ[node]



    else:

        irange = find(i,e,2*node + 1,inode,(inode+enode)// 2 )

        erange = find(i,e,2*node + 2,(inode+enode)//2 + 1,enode)

        return min(irange,erange)



f = sys.stdin

num,query = (int(n) for n in f.readline().split(' '))

initial = 2147483647

ln = 2 ** math.ceil(math.log2(num)) - 1

if num == 1:

    tail = 2

else:

    tail = 2 ** math.ceil(math.log2(num)) - num

global targ

targ = [initial] * (ln + num + tail)



for q in range(query):

    #print(targ)

    temp = [int(n) for n in f.readline().split(' ') ]

    if temp[0] == 0:

        update(temp[1] + ln,temp[2])

    else:

        print((find(temp[1],temp[2],0,0,ln)))
import math


def update(index, n):
    targ[index] = n
    index = (index - 1) // 2
    while True:
        targ[index] = min(targ[index * 2 + 1], targ[index * 2 + 2])
        if index <= 0:
            break
        index = (index - 1) // 2


def find(i, e, node, inode, enode):
    # print(i,e,node,inode,enode)
    if inode > e or enode < i:
        return float("inf")
    elif (i <= inode and enode <= e) or inode == enode:
        return targ[node]
    else:
        irange = find(i, e, 2 * node + 1, inode, (inode + enode) // 2)
        erange = find(i, e, 2 * node + 2, (inode + enode) // 2 + 1, enode)
        return min(irange, erange)


num, query = (int(n) for n in input().split(" "))
initial = 2147483647
ln = 2 ** math.ceil(math.log2(num)) - 1
if num == 1:
    tail = 2
else:
    tail = 2 ** math.ceil(math.log2(num)) - num
global targ
targ = [initial] * (ln + num + tail)
for q in range(query):
    # print(targ)
    temp = [int(n) for n in input().split(" ")]
    if temp[0] == 0:
        update(temp[1] + ln, temp[2])
    else:
        print((find(temp[1], temp[2], 0, 0, ln)))

import math
import sys


def update(index, n):
    targ[index] = n
    index = (index - 1) // 2
    while True:
        targ[index] = min(targ[index * 2 + 1], targ[index * 2 + 2])
        if index <= 0:
            break
        index = (index - 1) // 2


def find(i, e, node, inode, enode):
    # print(i,e,node,inode,enode)
    if inode > e or enode < i:
        return float("inf")
    elif (i <= inode and enode <= e) or inode == enode:
        return targ[node]
    else:
        irange = find(i, e, 2 * node + 1, inode, (inode + enode) // 2)
        erange = find(i, e, 2 * node + 2, (inode + enode) // 2 + 1, enode)
        return min(irange, erange)


f = sys.stdin
num, query = (int(n) for n in f.readline().split(" "))
initial = 2147483647
ln = 2 ** math.ceil(math.log2(num)) - 1
if num == 1:
    tail = 2
else:
    tail = 2 ** math.ceil(math.log2(num)) - num
global targ
targ = [initial] * (ln + num + tail)
for q in range(query):
    # print(targ)
    temp = [int(n) for n in f.readline().split(" ")]
    if temp[0] == 0:
        update(temp[1] + ln, temp[2])
    else:
        print((find(temp[1], temp[2], 0, 0, ln)))

+import sys -num, query = (int(n) for n in input().split(" ")) +f = sys.stdin +num, query = (int(n) for n in f.readline().split(" ")) -    temp = [int(n) for n in input().split(" ")] +    temp = [int(n) for n in f.readline().split(" ")]