// Slower C++ solution:
#include<bits/stdc++.h>



// Shrotening

#define fst first

#define snd second

#define pb push_back



// Loop

#define FOR(i,a,b) for(long i=(a);i<(b);++i)

#define RFOR(i,a,b) for(long i=(a);i>=(b);--i)



#define REP(i,a) FOR(i,0,a)

#define RREP(i,a) RFOR(i,a,0)



#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)

#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)



//Algorithm

#define ALL(a) (a).begin(), a.end()

#define RALL(a) (a).rbegin(), a.rend()

#define EXIST(a,x) ((a).find(x)!=(a).end())

#define SORT(a) sort(ALL(a))



//Setting

#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);



//debug message

bool debug = true;

#define MSG(s)   if(debug){std::cout << s << std::endl;}

#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}



//alias

typedef long long LL;

typedef std::vector<int> VI;

typedef std::vector<long> VL;

typedef std::vector<long long> VLL;

typedef std::pair<int,int> PII;



template<class T>

struct RMQ {

    T sz;

    T sq;



    std::vector<T> data;

    std::vector<T> bucket;

    RMQ(T size){

        sq = std::ceil(std::sqrt(size));

        sz = size;

        data.resize(size, -1);

        bucket.resize(sq, -1);

    }  

    RMQ(T size, T init): data(size, init){

        sq = std::ceil(std::sqrt(size));

        sz = size;

        data.resize(size, init);

        bucket.resize(sq, init);

    }

    void update(T i, T x) {

        data[i] = x;

        T minVal = data[i];

        T k = i / sq;

        FOR(j,k*sq,(k+1)*sq) {

            minVal = std::min(minVal, data[j]);

        }

        bucket[k] = minVal;

    }

    T find(T s, T t) {

        if(s == t) return data[s];

        T val = (1LL << 31) - 1;

        REP(i, sq) {

            T l = i*sq, r = (i+1)*sq;

            if(r <= s || t <= l) {

                continue;

            }

            

            if(s <= l && r <= t) {

                val = std::min(val, bucket[i]);

            } else {

                FOR(j, std::max(s, l), std::min(t, r) + 1) {

                    val = std::min(val, data[j]);

                }

            }

        }

        return val;

    }

};



int main(){

    int n, q, c, x, y;

    std::cin >> n >> q;

    RMQ<long> rmq = RMQ<long>(100000, (1LL << 31) - 1);

    REP(i, q) {

        std::cin >> c >> x >> y;

        if(c == 0) {

            rmq.update(x, y);

        } else {

            std::cout << rmq.find(x, y) << std::endl;

        }

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8009616773087131x):
#include<bits/stdc++.h>



// Shrotening

#define fst first

#define snd second

#define pb push_back



// Loop

#define FOR(i,a,b) for(long i=(a);i<(b);++i)

#define RFOR(i,a,b) for(long i=(a);i>=(b);--i)



#define REP(i,a) FOR(i,0,a)

#define RREP(i,a) RFOR(i,a,0)



#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)

#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)



//Algorithm

#define ALL(a) (a).begin(), a.end()

#define RALL(a) (a).rbegin(), a.rend()

#define EXIST(a,x) ((a).find(x)!=(a).end())

#define SORT(a) sort(ALL(a))



//Setting

#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);



//debug message

bool debug = true;

#define MSG(s)   if(debug){std::cout << s << std::endl;}

#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}



//alias

typedef long long LL;

typedef std::vector<int> VI;

typedef std::vector<long> VL;

typedef std::vector<long long> VLL;

typedef std::pair<int,int> PII;



template<class T>

struct SegTree {

    std::vector<T> tree;

    T INF;

    size_t N;

    std::function<bool(T,T)> pred;



    SegTree(size_t size, T inf, std::function<bool(T,T)> p) {

        INF = inf;

        pred = p;



        N = 1;

        while( N < size ) {

            N <<= 1;

        }

        tree.resize(2*N-1, INF);

    }



    void update(int i, int x) {

        i += N - 1;

        tree[i] = x;



        while(i > 0) {

            i = (i-1)/2;

            tree[i] = pred(tree[i*2+1],tree[i*2+2]) 

                        ? tree[i*2+1] 

                        : tree[i*2+2];

        }

    }



    T query(size_t a, size_t b) {

        return query(a, b, 0, 0, N);

    }

    T query(size_t a, size_t b, size_t k, size_t l, size_t r) {

        if( r <= a || b <= l ) {

            return INF;

        }

        if( a <= l && r <= b ) {

            return tree[k];

        } else {

            T vl = query(a, b, k*2+1, l, (l+r)/2);

            T vr = query(a, b, k*2+2, (l+r)/2, r);

            return pred(vl, vr) ? vl : vr;

        }

    }

};



int main(){

    int n, q, c, x, y;

    std::cin >> n >> q;



    SegTree<long> st = SegTree<long>(n, (1LL << 31) - 1, [](long x, long y){return x < y;});

    REP(i, q) {

        std::cin >> c >> x >> y;

        if(c == 0) {

            st.update(x,y);

        } else {

            std::cout << st.query(x, y+1) << std::endl;

        }

    }

}