using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, Q;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                N = line[0];
                Q = line[1];
            }

            var S = new SegTree(N);

            for(int i = 0; i < Q; i++)
            {
                var line = Input.ReadIntArray();
                int C = line[0];
                int X = line[1];
                int Y = line[2];

                if (C == 0) S.Update(X, Y);
                if (C == 1) Console.WriteLine(S.Query(X, Y + 1));
            }

        }
    }

    // libs ----------
    internal class SegTree
    {
        public int N;
        public int NCells;
        public int[] Data;
        public int[] KL; // 範囲のbegin
        public int[] KR; // 範囲のend（そのセルは含まない）
        public const int Dummy = 2147483647; // 2^31-1

        public SegTree(int _n)
        {
            Init(_n);
        }

        private int GetN(int _n)
        {
            int n = 1;
            while (n < _n) n *= 2;
            return n;
        }

        private void Init(int _n, int initialValue = Dummy)
        {
            N = GetN(_n);
            NCells = 2 * N - 1;

            Data = new int[NCells];
            KL = new int[NCells];
            KR = new int[NCells];

            // KL, KRの初期化
            for (int k = 0; k < NCells; k++)
            {
                if (IsRoot(k))
                {
                    KL[k] = 0;
                    KR[k] = N;
                }
                else
                {
                    if (IsChildL(k))
                    {
                        KL[k] = KL[Parent(k)];
                        KR[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                    }
                    else
                    {
                        KL[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                        KR[k] = KR[Parent(k)];
                    }
                }
            }

            // 値の初期化
            for (int k = 0; k < NCells; k++) Data[k] = initialValue;

        }

        // i番目のみの値を保持するセル
        public int Pos(int i) { return i + N - 1; }

        // 親セル・子セル
        public int Parent(int k) { return (k - 1) / 2; }
        public int ChildL(int k) { return k * 2 + 1; }
        public int ChildR(int k) { return k * 2 + 2; }

        // 根かどうか
        public bool IsRoot(int k) { return k == 0; }

        // 左側の子かどうか
        public bool IsChildL(int k)
        {
            if (IsRoot(k)) return false;
            return ChildL(Parent(k)) == k;
        }

        // Update - bottom up
        public void Update(int i, int a)
        {
            int k = Pos(i);
            // Update Logic
            Data[k] = a;
            while (!IsRoot(k))
            {
                // Update Logic
                k = Parent(k);
                Data[k] = Math.Min(Data[ChildL(k)], Data[ChildR(k)]);
            }
        }

        // Query - top down
        public int Query(int il, int ir)
        {
            return query(il, ir, 0);
        }

        private int query(int il, int ir, int k)
        {
            int kl = KL[k];
            int kr = KR[k];

            // [Query Logic]
            if (kr <= il || ir <= kl) return Dummy;
            if (il <= kl && kr <= ir) return Data[k];
            else
            {
                int vl = query(il, ir, ChildL(k));
                int vr = query(il, ir, ChildR(k));
                return Math.Min(vl, vr);
            }
        }
    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}


Measured memory_bytes: 14580