// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)
using ll = std::int64_t;
using ull = std::uint64_t;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return vec<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec

#ifdef DEBUGGING
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

namespace segtree {

template <typename T>
struct SegmentTree {
    using Merge = std::function<T(T, T)>;
    vec<T> nodes;
    Merge merge_f;
    T id_ele;

    SegmentTree(const vec<T> &init_v, Merge merge_f, T id_ele) 
        : nodes(ceil_pow2(init_v.size()) * 2 - 1, id_ele), merge_f(merge_f), id_ele(id_ele)
    {
        ssize_t s = size();
        for (ssize_t i = 0; i < init_v.size(); i++) nodes[i + s - 1] = init_v[i];
        for (ssize_t i = s - 2; 0 <= i; i--) nodes[i] = get_merged(i);
    }

    size_t size() const {
        return (nodes.size() + 1) / 2;
    }

    const T& operator [](ll idx) const {
        return nodes[idx + size() - 1];
    }

    T get_query(ll ql, ll qr, ll nl, ll nr, ll nidx) const {
        if (nr <= ql || qr <= nl) return id_ele;
        if (ql <= nl && nr <= qr) return nodes[nidx];
        ll mid = (nl + nr) / 2;
        ll lidx, ridx;
        std::tie(lidx, ridx) = get_children_idx(nidx);
        auto lv = get_query(ql, qr, nl, mid, lidx);
        auto rv = get_query(ql, qr, mid, nr, ridx);
        return merge_f(lv, rv);
    }

    T get_query(ll ql, ll qr) const {
        return get_query(ql, qr, 0, size(), 0);
    }

    void update_query(ll idx, T val) {
        idx += size() - 1;
        nodes[idx] = val;
        while (idx) {
            ll pidx = (idx - 1) / 2;
            nodes[pidx] = get_merged(pidx);
            idx = pidx;
        }
    }

    // FIXME : test
    T lower_bound(ll idx, std::function<bool(T)> check, T sum) const {
        if (size() - 1 <= idx) return idx - (size() - 1);
        ll lidx, ridx;
        std::tie(lidx, ridx) = get_children_idx(idx);
        auto lv = merge_f(sum, nodes[lidx]);
        if (check(lv)) return lower_bound(lidx, check, sum);
        else return lower_bound(ridx, check, lv);
    }

    T lower_bound(std::function<bool(T)> check) const {
        return lower_bound(0, check, id_ele);
    }

private:
    ssize_t ceil_pow2(ssize_t s) {
        ssize_t ret = 1;
        while (ret <= s) ret *= 2;
        return ret;
    }

    pll get_children_idx(ll idx) const {
        return pll(2 * idx + 1, 2 * idx + 2);
    }

    T get_merged(ll idx) const {
        ll a, b;
        std::tie(a, b) = get_children_idx(idx);
        return merge_f(nodes[a], nodes[b]);
    }
};

}
using namespace std;
int main() {
    ll n, q;
    cin >> n >> q;
    ll init = (1ll << 31) - 1;
    segtree::SegmentTree<ll> seg(vec<ll>(n, init), [](ll a, ll b) { return min(a, b); }, init);
    while (q--) {
        ll c, x, y;
        cin >> c >> x >> y;
        if (c == 0) seg.update_query(x, y);
        else cout << seg.get_query(x, y + 1) << endl;
    }
    return 0;
}



Measured memory_bytes: 5752