#include <bits/stdc++.h>

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }

template <typename T,typename E>
class SegmentTree {
public:
    size_t n;
    T      d1;
    std::vector<T> dat;
    std::function<T(T,T)> f;
    std::function<T(T,E)> g;
    SegmentTree(const size_t& _n,
                const std::function<T(T,T)>& _f,
                const std::function<T(T,E)>& _g,
                const T& _d1,
                const std::vector<T>& v = vector<T>()) :
        d1(_d1), f(_f), g(_g) {
        init(_n);
        if(_n == v.size()) build(_n, v);
    }

    void init(const size_t& _n) {
        n = 1;
        while(n < _n) n *= 2;
        dat.clear();
        dat.resize(2 * n - 1, d1);
    }

    void build(const int& _n,
               const std::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,
                const E& a) {
        k += n - 1;
        dat[k] = g(dat[k], a);
        while(0 < k) {
            k = (k - 1) / 2;
            dat[k] = f(dat[k * 2 + 1], dat[k * 2 + 2]);
        }
    }

    T query(const int& a,
            const int& b,
            const int& k,
            const int& l,
            const int& r) {
        if(r <= a || b <= l) return d1;
        if(a <= l && r <= b) return dat[k];
        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 f(vl, vr);
    }

    T query(const int& a,
            const int& b) {
        return query(a, b, 0, 0 ,n);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, Q;
    std::cin >> N >> Q;

    SegmentTree<int, int> rmq(N,
                              [](int a, int b){ return min(a, b); },
                              [](int a, int b){ return b; },
                              INT_MAX);
    REP(i, Q) {
        int C, X, Y;
        std::cin >> C >> X >> Y;
        if(C) cout << rmq.query(X, Y + 1) << "\n";
        else rmq.update(X, Y);
    }
    return 0;
}



Measured memory_bytes: 3800