#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
// F : 要素
// E : 作用素
// F : 要素と要素のマージ
// G : 要素と作用素のマージ
template<typename T, typename E, typename F, typename G>
class SegmentTree {
    int N;
    F f;
    G g;
    T ti;
    vector<T> dat;

public:
    SegmentTree(int n, F f, G g, T ti) : N(1), f(f), g(g), ti(ti) {
        while (N < n) {
            N <<= 1;
        }
        dat.resize(2 * N - 1, ti);
    }

    void build(int n, vector<T> v) {
        for (int i = 0; i < n; ++i) {
            dat[i + N - 1] = v[i];
        }
        for (int i = N - 2; i >= 0; --i) {
            dat[i] = f(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }

    void update(int k, T t) {
        k += N - 1;
        dat[k] = g(dat[k], t);
        while (k > 0) {
            k = (k - 1) / 2;
            dat[k] = f(dat[k * 2 + 1], dat[k * 2 + 2]);
        }

//        dat[k + N - 1] = g(dat[k + N - 1], t);
//        for (int i = (k + N - 2) / 2;; i = (i - 1) / 2) {
//            dat[i] = f(dat[i * 2 + 1], dat[i * 2 + 2]);
//            if (i == 0) break;
//        }
    }

    T query(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) {
            return ti;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            T left = query(a, b, k * 2 + 1, l, (l + r) / 2);
            T right = query(a, b, k * 2 + 2, (l + r) / 2, r);
            return f(left, right);
        }
    }

    T query(int a, int b) {
        return query(a, b, 0, 0, N);
    }

};

class Solve {
public:
    void solve() {
        int n, q;
        cin >> n >> q;

        auto f = [](Int a, Int b) -> Int {
            return min(a, b);
        };
        auto g = [](Int a, Int b) -> Int {
            return b;
        };

        SegmentTree<Int, Int, decltype(f), decltype(g)> segmentTree(n, f, g, 2147483647);

        while (q--) {
            Int c, x, y;
            cin >> c >> x >> y;
            if (c == 0) {
//                x--;
                segmentTree.update(x, y);
            } else {
//                x--;
                y++;
                Int ans = segmentTree.query(x, y);
                cout << ans << endl;
            }

        }

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}



Measured memory_bytes: 4960