#include <bits/stdc++.h>

template <typename T>
struct MinMonoid {
    /// ??????
    using value_type = T;
    /// ?????????????????????????????????
    constexpr T id() const {
        return std::numeric_limits<T>::max();
    }
    /// ???????????????????????¢??°
    static T op(const T &a, const T &b) {
        return std::min(a, b);
    }
};

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

private:
    Trait monoid;
    std::vector<value_type> m_data;
    size_t m_size;

    void initialize(){
        for(int i = static_cast<int>(m_size) - 2; i >= 0; --i){
            m_data[i] = monoid.op(m_data[i * 2 + 1], m_data[i * 2 + 2]);
        }
    }

    value_type query(int a, int b, int k, int l, int r) const {
        if(r <= a || b <= l){ return monoid.id(); }
        if(a <= l && r <= b){ return m_data[k]; }
        const value_type vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
        const value_type vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
        return monoid.op(vl, vr);
    }

public:
    explicit SegmentTree(size_t size = 0, const Trait &traits = Trait()) :
        monoid(traits), m_size(1)
    {
        while(m_size < size){ m_size *= 2; }
        m_data.assign(m_size * 2 - 1, monoid.id());
        initialize();
    }

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

    void update(size_t i, const value_type &val){
        i += m_size - 1;
        m_data[i] = val;
        while(i > 0){
            i = (i - 1) / 2;
            m_data[i] = monoid.op(m_data[i * 2 + 1], m_data[i * 2 + 2]);
        }
    }

    value_type query(size_t a, size_t b) const {
        return query(a, b, 0, 0, m_size);
    }

    value_type operator[](size_t i) const {
        return m_data[m_size + i];
    }
};

#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)
const int MOD = 1000000007;

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)


template<typename T>
using rmq = SegmentTree<MinMonoid<T>>;

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: 3860