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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , "; logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */

/*
struct segtree{
    int n; lint arr[MAX];
    segtree(int n_){
        n = 2;
        while(n < n_) n *= 2;
        rep(i, n*2) arr[i] = INF;
    }
    void update(int k, lint a){
        k += n - 1;
        arr[k] = a;
        while(k > 0){
            k = (k - 1) / 2;
            arr[k] = min(arr[k * 2 + 1], arr[k * 2 + 2]);
        }
    }
    lint query_(int a, int b, int k, int l, int r){
        if(r <= a || b <= l) return INF;
        if(a <= l && r <= b) return arr[k];
        else{
            lint vl = query_(a, b, k * 2 + 1, l, (l + r) / 2);
            lint vr = query_(a, b, k * 2 + 2, (l + r) / 2, r);
            return min(vl, vr);
        }
    }
    lint query(int a, int b){
        return query_(a, b, 0, 0, n);
    }
}; */

template<class T>
class segtree{
    public:
    int n; vector<T> data;
    T id;
    function<T(T,T)> op;
    function<T(T,T)> upd;
    segtree(size_t _n, T _id, function<T(T,T)> _op, function<T(T,T)> _upd)
    : id(_id), op(_op), upd(_upd){
        n = 1;
        while(n < _n) n *= 2;
        data = vector<T>(2*n-1, id);
    }
    T _query(int a, int b, int k, int l, int r){
        if(r <= a || b <= l) return id;
        if(a <= l && r <= b) return data[k];
        else{
            T ll = _query(a, b, k*2+1, l, (l+r)/2);
            T rr = _query(a, b, k*2+2, (l+r)/2, r);
            return op(ll, rr);
        }
    }
    T query(int a, int b){
        return _query(a, b, 0, 0, n);
    }
    void update(int i, T x){
        i += n-1;
        data[i] = upd(data[i], x);
        while(i > 0){
            i = (i-1)/2;
            data[i] = op(data[i*2+1], data[i*2+2]);
        }
    }
    T operator[](int i){
        return data[i+n-1];
    }
};

int main(){
    int n, q; cin >> n >> q;
    segtree<lint> st(n, (1LL<<31)-1, 
        [](lint l, lint r){ return min(l, r); },
        [](lint d, lint x){ return x; });
    rep(i,q){
        lint c, x, y; cin >> c >> x >> y;
        if(c==0) st.update(x, y);
        else{
            out(st.query(x, y+1));
        }
    }    
}


Measured memory_bytes: 4888