from math import sqrt, ceil



def_val = 2 ** 31 - 1

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

unit = ceil(sqrt(n))



l = [(def_val, [def_val] * unit) for _ in range(unit)]



while q:

    op, s, t = list(map(int, input().split()))

    sd, sm = s // unit, s % unit

    if op:

        td, tm = t // unit, t % unit

        if sd == td:

            print((min(l[sd][1][sm:tm + 1])))

        else:

            unit_min = min((tup[0] for tup in l[sd + 1:td]), default=def_val)

            s_min = min(l[sd][1][sm:], default=def_val)

            t_min = min(l[td][1][:tm + 1], default=def_val)

            print((min(unit_min, s_min, t_min)))

    else:

        unit_list = l[sd][1]

        unit_list[sm] = t

        l[sd] = (min(unit_list), unit_list)

    q -= 1
class SegTreeMin:

    def __init__(self, n):

        n2 = 1

        while n2 < n:

            n2 <<= 1

        self.n2 = n2

        self.tree = [(1 << 31) - 1] * (n2 << 1)

        self.output = []



    def update(self, i, x):

        i += self.n2

        self.tree[i] = x

        while i > 1:

            self.tree[i >> 1] = x = min(x, self.tree[i ^ 1])

            i >>= 1



    def get_min(self, s, t):

        self.output.append(self._get_min(s, t + 1, 1, 0, self.n2))



    def _get_min(self, a, b, k, l, r):

        if r <= a or b <= l:

            return (1 << 31) - 1

        if a <= l and r <= b:

            return self.tree[k]

        m = (l + r) // 2

        return min(

            self._get_min(a, b, k << 1, l, m),

            self._get_min(a, b, (k << 1) + 1, m, r))



    def print(self):

        print('\n'.join(map(str, self.output)))





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

st = SegTreeMin(n)

fs = [st.update, st.get_min]

for c, x, y in (map(int, input().split()) for _ in range(q)):

    fs[c](x, y)

st.print()

from math import sqrt, ceil

def_val = 2**31 - 1
n, q = list(map(int, input().split()))
unit = ceil(sqrt(n))
l = [(def_val, [def_val] * unit) for _ in range(unit)]
while q:
    op, s, t = list(map(int, input().split()))
    sd, sm = s // unit, s % unit
    if op:
        td, tm = t // unit, t % unit
        if sd == td:
            print((min(l[sd][1][sm : tm + 1])))
        else:
            unit_min = min((tup[0] for tup in l[sd + 1 : td]), default=def_val)
            s_min = min(l[sd][1][sm:], default=def_val)
            t_min = min(l[td][1][: tm + 1], default=def_val)
            print((min(unit_min, s_min, t_min)))
    else:
        unit_list = l[sd][1]
        unit_list[sm] = t
        l[sd] = (min(unit_list), unit_list)
    q -= 1

class SegTreeMin:
    def __init__(self, n):
        n2 = 1
        while n2 < n:
            n2 <<= 1
        self.n2 = n2
        self.tree = [(1 << 31) - 1] * (n2 << 1)
        self.output = []

    def update(self, i, x):
        i += self.n2
        self.tree[i] = x
        while i > 1:
            self.tree[i >> 1] = x = min(x, self.tree[i ^ 1])
            i >>= 1

    def get_min(self, s, t):
        self.output.append(self._get_min(s, t + 1, 1, 0, self.n2))

    def _get_min(self, a, b, k, l, r):
        if r <= a or b <= l:
            return (1 << 31) - 1
        if a <= l and r <= b:
            return self.tree[k]
        m = (l + r) // 2
        return min(
            self._get_min(a, b, k << 1, l, m), self._get_min(a, b, (k << 1) + 1, m, r)
        )

    def print(self):
        print("\n".join(map(str, self.output)))


n, q = map(int, input().split())
st = SegTreeMin(n)
fs = [st.update, st.get_min]
for c, x, y in (map(int, input().split()) for _ in range(q)):
    fs[c](x, y)
st.print()

-from math import sqrt, ceil +class SegTreeMin: +    def __init__(self, n): +        n2 = 1 +        while n2 < n: +            n2 <<= 1 +        self.n2 = n2 +        self.tree = [(1 << 31) - 1] * (n2 << 1) +        self.output = [] -def_val = 2**31 - 1 -n, q = list(map(int, input().split())) -unit = ceil(sqrt(n)) -l = [(def_val, [def_val] * unit) for _ in range(unit)] -while q: -    op, s, t = list(map(int, input().split())) -    sd, sm = s // unit, s % unit -    if op: -        td, tm = t // unit, t % unit -        if sd == td: -            print((min(l[sd][1][sm : tm + 1]))) -        else: -            unit_min = min((tup[0] for tup in l[sd + 1 : td]), default=def_val) -            s_min = min(l[sd][1][sm:], default=def_val) -            t_min = min(l[td][1][: tm + 1], default=def_val) -            print((min(unit_min, s_min, t_min))) -    else: -        unit_list = l[sd][1] -        unit_list[sm] = t -        l[sd] = (min(unit_list), unit_list) -    q -= 1 +    def update(self, i, x): +        i += self.n2 +        self.tree[i] = x +        while i > 1: +            self.tree[i >> 1] = x = min(x, self.tree[i ^ 1]) +            i >>= 1 + +    def get_min(self, s, t): +        self.output.append(self._get_min(s, t + 1, 1, 0, self.n2)) + +    def _get_min(self, a, b, k, l, r): +        if r <= a or b <= l: +            return (1 << 31) - 1 +        if a <= l and r <= b: +            return self.tree[k] +        m = (l + r) // 2 +        return min( +            self._get_min(a, b, k << 1, l, m), self._get_min(a, b, (k << 1) + 1, m, r) +        ) + +    def print(self): +        print("\n".join(map(str, self.output))) + + +n, q = map(int, input().split()) +st = SegTreeMin(n) +fs = [st.update, st.get_min] +for c, x, y in (map(int, input().split()) for _ in range(q)): +    fs[c](x, y) +st.print()