#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

template<class T>
class SegmentTree
{
public:ssize_t
        long long n;
        std::vector<T> nodes;

        SegmentTree(std::vector<T> v)
        {
                long long sz = (long long)v.size();
                n = 1;
                while (n < sz) n *= 2;
                nodes.resize(2*n - 1, (1LL<<31)-1);

                for (long long i = 0; i < sz; ++i) {
                        nodes[(n-1) + i] = v[i];       
                }
                for (long long i = n-2; i >= 0; --i) {
                        nodes[i] = min(nodes[2*i + 1], nodes[2*i + 2]);
                }
        }

        void update(T pos, T val)
        {
                pos += n - 1;
                nodes[pos] = val;

                while (pos > 0) {
                        pos = (pos - 1) / 2;
                        nodes[pos] = min(nodes[2*pos + 1], nodes[2*pos + 2]);
                }
        }

        // [a, b]
        T find(T a, T b, T k=0, T l=0, T r=-1)
        {
                if (r < 0) {
                        r = n;
                        ++b;
                }
                if (r <= a or b <= l) return (1LL<<31)-1;
                if (a <= l and r <= b) return nodes[k];
                return min(
                        find(a, b, 2*k+1, l, (l+r)/2),
                        find(a, b, 2*k+2, (l+r)/2, r)
                );
        }


};





int main()
{
        ll n, q;
        cin >> n >> q;
        vll v(n, (1LL<<31)-1);
        SegmentTree<ll> tree(v);
        rep(i, 0, q) {
                ll com, x, y;
                cin >> com >> x >> y;
                if (com == 0) {
                        tree.update(x, y);
                } else {
                        cout << tree.find(x, y) << endl;
                }
        }
}


Measured memory_bytes: 6552