#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define int long long

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = (1ll << 31) - 1;
const ll linf = 3e18;
const double eps = 1e-9;

struct SegTree { // ??????min,max
    int n;
    vector<int> Max;
    vector<int> Min;

    void init(int n_)
    {
        n = 1;
        while (n < n_) n *= 2;

        Max.resize(2 * n);
        Min.resize(2 * n);

        for (int i = 0; i < 2 * n - 1; ++i) {
            Max[i] = -inf;
            Min[i] = inf;
        }
    }

    void min_update(int idx, int val)
    {
        idx += n - 1;
        Min[idx] = val;

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

    void max_update(int idx, int val)
    {
        idx += n - 1;
        Max[idx] = val;

        while (idx > 0) {
            idx = (idx - 1) / 2;
            Max[idx] = max(Max[idx * 2 + 1], Max[idx * 2 + 2]);
        }
    }

    int get_min(int a, int b, int k = 0, int l = 0, int r = -1) // [a, b)???min
    {
        if (r == -1) r = n;

        if (r <= a || b <= l) return inf;

        if (a <= l && r <= b) return Min[k];

        int vl = get_min(a, b, k * 2 + 1, l, (l + r) / 2);
        int vr = get_min(a, b, k * 2 + 2, (l + r) / 2, r);

        return min(vl, vr);
    }

    int get_max(int a, int b, int k = 0, int l = 0, int r = -1) // [a, b)???max
    {
        if (r == -1) r = n;

        if (r <= a || b <= l) return -inf;

        if (a <= l && r <= b) return Max[k];

        int vl = get_max(a, b, k * 2 + 1, l, (l + r) / 2);
        int vr = get_max(a, b, k * 2 + 2, (l + r) / 2, r);

        return max(vl, vr);
    }
};

signed main()
{
    omajinai;

    int N, Q; cin >> N >> Q;

    SegTree seg;
    seg.init(N);

    rep(i, Q) {
        int type, x, y; cin >> type >> x >> y;

        if (type == 0) {
            seg.min_update(x, y);
        } else {
            cout << seg.get_min(x, y + 1) << endl;
        }
    }
}

Measured memory_bytes: 5228