#include <bits/stdc++.h>

template <typename Trait>
class SegmentTree {
public:
    /// ??????
    using T = typename Trait::value_type;

private:
    Trait m;
    std::vector<T> x;
    std::size_t size;

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

    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]; }
        const std::size_t sm = (sl + sr) / 2;
        const T vl = query(ql, qr, k * 2 + 0, sl, sm);
        const T vr = query(ql, qr, k * 2 + 1, sm, sr);
        return m(vl, vr);
    }

public:
    SegmentTree(std::size_t n = 0, const Trait &traits = Trait())
        : m(traits), size(1) {
        while(size < n){ size *= 2; }
        x.assign(size * 2, m.id());
        initialize();
    }

    template <typename Iterator>
    SegmentTree(Iterator first, Iterator last, const Trait &traits = Trait())
        : size(1), m(traits) {
        const std::size_t n = distance(first, last);
        while(size < n){ size *= 2; }
        x.resize(size * 2, m.default_value());
        copy(first, last, x.begin() + size);
        initialize();
    }

    void update(std::size_t i, const T &val){
        i += size;
        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, size);
    }

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

template <typename T>
struct MinMonoid {
    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 = SegmentTree<MinMonoid<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: 3892