using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

class SegmentTree<T> {
    public int Size;
    public T[] Node;
    public Func<T, T, T> Calc;
    T Def;

    public SegmentTree(int n, T[] init, T def, Func<T, T, T> calc) {
        Calc = calc;
        Def = def;
        Size = 1;
        while(Size < n) Size *= 2;
        Node = new T[2 * Size - 1];
        for(int i = 0; i < init.Length; i++) {
            Node[(Size - 1) + i] = init[i];
        }
        for(int i = init.Length; i < Size; i++) {
            Node[(Size - 1) + i] = Def;
        }
        for(int i = (Size - 1) - 1; 0 <= i; i--) {
            Node[i] = Calc(Node[2 * i + 1], Node[2 * i + 2]);
        }
    }

    public void Update(int index, T value) {
        int pos = (Size - 1) + index;
        Node[pos] = value;
        while(0 < pos) {
            pos = (pos - 1) / 2;
            Node[pos] = Calc(Node[2 * pos + 1], Node[2 * pos + 2]);
        }
    }

    public T GetRange(int index, int length) {
        return GetRange(index, length, 0, 0, Size);
    }

    public T GetRange(int index, int length, int k, int l, int r) {
        if(r <= index || index + length <= l) {
            return Def;
        }
        if(index <= l && r <= index + length) {
            return Node[k];
        }
        T vl = GetRange(index, length, k * 2 + 1, l, (l + r) / 2);
        T vr = GetRange(index, length, k * 2 + 2, (l + r) / 2, r);
        return Calc(vl, vr);
    }
}

class A {
    static StreamWriter Out = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    static void Main(string[] args) {
        int n, q;
        Input(out n, out q);
        SegmentTree<int> seg = new SegmentTree<int>(n, new int[0], int.MaxValue, (a, b) => Math.Min(a, b));
        for(int i = 0; i < q; i++) {
            int t, x, y;
            Input(out t, out x, out y);
            if(t == 0) {
                seg.Update(x, y);
            } else {
                Print(seg.GetRange(x, y - x + 1));
            }
        }
        Out.Flush();
    }
    static T ChangeT<T>(string s) => (T)Convert.ChangeType(s, typeof(T));
    static void Input<A>(out A a) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
    }
    static void Input<A, B>(out A a, out B b) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
    }
    static void Input<A, B, C>(out A a, out B b, out C c) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
    }
    static void Input<A, B, C, D>(out A a, out B b, out C c, out D d) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
    }
    static void Input<A, B, C, D, E>(out A a, out B b, out C c, out D d, out E e) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
    }
    static void Input<A, B, C, D, E, F>(out A a, out B b, out C c, out D d, out E e, out F f) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
        f = ChangeT<F>(words[5]);
    }
    static void Inputs<T>(out T[] array) {
        array = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries).Select(s => ChangeT<T>(s)).ToArray();
    }
    static void Print<T>(T s) => Out.WriteLine(s);
    static void Print<T>(params T[] s) => Out.WriteLine(string.Join(" ", s));
    static void Print<T>(IEnumerable<T> e) => Out.WriteLine(string.Join(" ", e));
}


Measured memory_bytes: 20728