n, q = list(map(int, input().split()))

n0 = 2**n.bit_length()

INF = 2**31-1

data = [INF]*(n0*2)

def update(k, a):

    k += n0 - 1

    data[k] = a

    while k:

        k = (k - 1) / 2

        data[k] = min(data[2*k+1], data[2*k+2])

def query(a, b, k, l, r):

    if b <= l or r <= a:

        return INF

    if a <= l and r <= b:

        return data[k]

    vl = query(a, b, 2*k+1, l, (l + r) / 2)

    vr = query(a, b, 2*k+2, (l + r) / 2, r)

    return min(vl, vr)

def find(s, t):

    print(query(s, t+1, 0, 0, n0))

for i in range(q):

    com, x, y = list(map(int, input().split()))

    [update, find][com](x, y)
import sys

readline = sys.stdin.readline

write = sys.stdout.write

N, Q = list(map(int, readline().split()))



N0 = 2**(N-1).bit_length()

INF = 2**31-1

data = [INF]*(2*N0)

def update(k, x):

    k += N0-1

    data[k] = x

    while k >= 0:

        k = (k - 1) // 2

        data[k] = min(data[2*k+1], data[2*k+2])

def query(l, r):

    L = l + N0; R = r + N0

    s = INF

    while L < R:

        if R & 1:

            R -= 1

            s = min(s, data[R-1])



        if L & 1:

            s = min(s, data[L-1])

            L += 1

        L >>= 1; R >>= 1

    return s





ans = []

for q in range(Q):

    t, x, y = list(map(int, readline().split()))

    if t:

        ans.append(str(query(x, y+1)))

    else:

        update(x, y)

write("\n".join(ans))

write("\n")



n, q = list(map(int, input().split()))
n0 = 2 ** n.bit_length()
INF = 2**31 - 1
data = [INF] * (n0 * 2)


def update(k, a):
    k += n0 - 1
    data[k] = a
    while k:
        k = (k - 1) / 2
        data[k] = min(data[2 * k + 1], data[2 * k + 2])


def query(a, b, k, l, r):
    if b <= l or r <= a:
        return INF
    if a <= l and r <= b:
        return data[k]
    vl = query(a, b, 2 * k + 1, l, (l + r) / 2)
    vr = query(a, b, 2 * k + 2, (l + r) / 2, r)
    return min(vl, vr)


def find(s, t):
    print(query(s, t + 1, 0, 0, n0))


for i in range(q):
    com, x, y = list(map(int, input().split()))
    [update, find][com](x, y)

import sys

readline = sys.stdin.readline
write = sys.stdout.write
N, Q = list(map(int, readline().split()))
N0 = 2 ** (N - 1).bit_length()
INF = 2**31 - 1
data = [INF] * (2 * N0)


def update(k, x):
    k += N0 - 1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = min(data[2 * k + 1], data[2 * k + 2])


def query(l, r):
    L = l + N0
    R = r + N0
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = min(s, data[R - 1])
        if L & 1:
            s = min(s, data[L - 1])
            L += 1
        L >>= 1
        R >>= 1
    return s


ans = []
for q in range(Q):
    t, x, y = list(map(int, readline().split()))
    if t:
        ans.append(str(query(x, y + 1)))
    else:
        update(x, y)
write("\n".join(ans))
write("\n")

-n, q = list(map(int, input().split())) -n0 = 2 ** n.bit_length() +import sys + +readline = sys.stdin.readline +write = sys.stdout.write +N, Q = list(map(int, readline().split())) +N0 = 2 ** (N - 1).bit_length() -data = [INF] * (n0 * 2) +data = [INF] * (2 * N0) -def update(k, a): -    k += n0 - 1 -    data[k] = a -    while k: -        k = (k - 1) / 2 +def update(k, x): +    k += N0 - 1 +    data[k] = x +    while k >= 0: +        k = (k - 1) // 2 -def query(a, b, k, l, r): -    if b <= l or r <= a: -        return INF -    if a <= l and r <= b: -        return data[k] -    vl = query(a, b, 2 * k + 1, l, (l + r) / 2) -    vr = query(a, b, 2 * k + 2, (l + r) / 2, r) -    return min(vl, vr) +def query(l, r): +    L = l + N0 +    R = r + N0 +    s = INF +    while L < R: +        if R & 1: +            R -= 1 +            s = min(s, data[R - 1]) +        if L & 1: +            s = min(s, data[L - 1]) +            L += 1 +        L >>= 1 +        R >>= 1 +    return s -def find(s, t): -    print(query(s, t + 1, 0, 0, n0)) - - -for i in range(q): -    com, x, y = list(map(int, input().split())) -    [update, find][com](x, y) +ans = [] +for q in range(Q): +    t, x, y = list(map(int, readline().split())) +    if t: +        ans.append(str(query(x, y + 1))) +    else: +        update(x, y) +write("\n".join(ans)) +write("\n")