#include <bits/stdc++.h>
using namespace std;

#define debug(x) cout <<"DEBUG"<<" "<<#x<<":"<<x<<'\n'

//↓0-indexか1-indexでn回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-index昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-index昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-index降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-index降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

/* 円周率は M_PI を使おうね */
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;

/*FUNCs=================================================*/
/* Segment Tree===================*/
/*!!!! 0-index !!!! */

template<class T_monoid>
class SegmentTree {
private:
    int SegSize;
    vector<T_monoid> Segments;
    const T_monoid InitValue;
    function<T_monoid(T_monoid, T_monoid)> Func;
    //query
    T_monoid Q(int p, int q, int node, int l, int r) {
        if(r <= p || q <= l) return InitValue;
        if(p <= l && r <= q) return Segments[node];
        else {
            T_monoid child1 = Q(p, q, node*2+1, l, (l+r)/2);
            T_monoid child2 = Q(p, q, node*2+2, (l+r)/2, r);
            return Func(child1, child2);
        }
    }

public:
    //construcor
    SegmentTree(int n, function<T_monoid(T_monoid,T_monoid)> func, T_monoid InitValue):
        Func(func), InitValue(InitValue) //initialize
    {
        SegSize = 1;
        while(SegSize < n) SegSize <<= 1;
        Segments.assign(SegSize*2-1, InitValue);
    }

    //construct//
    void input(int index, T_monoid value) {
        Segments[index+SegSize-1] = value;
    }
    void build() { 
        for(int i = SegSize-2; i >= 0; --i) {
            Segments[i] = Func(Segments[i*2+1], Segments[i*2+2]);
        }
    }

    //member funcs//
    void update(int index, T_monoid value) {
        index += SegSize -1;
        Segments[index] = value;
        while(index != 0) {
            index = (index-1)/2;
            Segments[index] = Func(Segments[index*2+1], Segments[index*2+2]);
        }
    }

    //query for [p, q)
    T_monoid query(int s, int t) {
        return Q(s, t, 0, 0, SegSize);
    }

    int size() {
        return SegSize;
    }

    T_monoid operator[] (int index) {
        return Segments[index+SegSize-1];
    }
};

/*MAIN==================================================*/
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    //cout << fixed << setprecision(10);

    int maxi = numeric_limits<int>::max();
    int n, q; cin >> n >> q;
    SegmentTree<int> seg(n, [](int a, int b){return min(a,b);}, maxi);
    rep(i,q) {
        int com, x, y; cin >>com >>x >>y;
        if(com == 0) seg.update(x, y);
        else cout << seg.query(x, y+1) << '\n';
    }
}


Measured memory_bytes: 3808