// http://codeforces.com/blog/entry/18051
//
#include <bits/stdc++.h>

template <typename monoid_trait> struct segment_tree {
    using monoid = monoid_trait;
    using T = typename monoid::value_type;

    monoid m;
    std::vector<T> x;
    std::size_t sz;

    void initialize() {
        for (int i = (int)sz - 1; i >= 1; --i) {
            x[i] = m(x[i * 2 + 0], x[i * 2 + 1]);
        }
    }

    T query(int l, int r) const {
        T res = m.id();
        for (l += sz, r += sz; l < r; l >>= 1, r >>= 1) {
            if (l & 1) {
                res = m(res, x[l++]);
            }
            if (r & 1) {
                res = m(res, x[--r]);
            }
        }
        return res;
    }

    // T query(int ql, int qr, int k, int sl, int sr) const {
    //     if (sr <= ql || qr <= sl) {
    //         return m.id();
    //     }
    //     if (ql <= sl && sr <= qr) {
    //         return x[k];
    //     }
    //     std::size_t sm = (sl + sr) / 2;
    //     T vl = query(ql, qr, k * 2 + 0, sl, sm);
    //     T vr = query(ql, qr, k * 2 + 1, sm, sr);
    //     return m(vl, vr);
    // }

    segment_tree(std::size_t n = 0, const monoid &trait = monoid())
        : m(trait), sz(1) {
        while (sz < n) {
            sz *= 2;
        }
        x.assign(sz * 2, m.id());
        initialize();
    }

    template <typename Iterator>
    segment_tree(Iterator first, Iterator last, const monoid &trait = monoid())
        : sz(1), m(trait) {
        std::size_t n = distance(first, last);
        while (sz < n) {
            sz *= 2;
        }
        x.resize(sz * 2, m.id());
        copy(first, last, x.begin() + sz);
        initialize();
    }

    void update(std::size_t i, const T &val) {
        i += sz;
        x[i] = val;
        while (i > 0) {
            i /= 2;
            x[i] = m(x[i * 2 + 0], x[i * 2 + 1]);
        }
    }

    // T query(std::size_t l, std::size_t r) const { return query(l, r, 1, 0, sz);
    // }

    T operator[](std::size_t i) const { return x[sz + i]; }
};

template <typename T> struct inf_min_monoid {
    using value_type = T;
    constexpr T id() const { return std::numeric_limits<T>::max(); }
    T operator()(const T &a, const T &b) const { return std::min(a, b); }
};

template <typename T> using rmq = segment_tree<inf_min_monoid<T>>;

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)

template <typename T> void __dump__(std::ostream &os, const T &first) {
    os << first;
}
template <typename First, typename... Rest>
void __dump__(std::ostream &os, const First &first, const Rest &... rest) {
    os << first << ", ";
    __dump__(os, rest...);
}
#define dump(...)                                           \
    do {                                                    \
        std::ostringstream os;                              \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = ";   \
        __dump__(os, __VA_ARGS__);                          \
        std::cerr << os.str() << std::endl;                 \
    } while (0)

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    while (cin >> n >> q) {
        rmq<int> st(n);
        rep(i, q) {
            int t;
            cin >> t;
            if (t == 0) {
                int k, x;
                cin >> k >> x;
                st.update(k, x);
            } else {
                int l, r;
                cin >> l >> r;
                ++r;
                cout << st.query(l, r) << '\n';
            }
        }
    }
}

Measured memory_bytes: 3848