#define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// #define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) begin(c), end(c)
#define range(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) range(i,0,b)
#define rangei(i,a,b) for(ll a=a;i<=ll(b);i++)
#define repi(i,b) rangei(i,1,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
template<class T> ostream & operator << (ostream &os, vector<T> const &);
template<int n, class...T>
typename enable_if<(n>=sizeof...(T))>::type
_ot(ostream &, tuple<T...> const &){}
template<int n, class...T>
typename enable_if<(n< sizeof...(T))>::type
_ot(ostream &os, tuple<T...> const &t){
    os << (n==0?"":" ") << get<n>(t); _ot<n+1>(os, t);
}
template<class...T>
ostream & operator << (ostream &os, tuple<T...> const &t){
    _ot<0>(os, t); return os;
}
template<class T, class U>
ostream & operator<<(ostream &os, pair<T,U> const &p){
    return os << "(" << p.first << ", " << p.second << ") ";
}
template<class T>
ostream & operator<<(ostream &os, vector<T> const &v){
    os << "{ ";
    rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?" ":", ");
    return os << "}";
}
#ifdef DEBUG
#define dump(...) (cerr << "\x1b[32m" << #__VA_ARGS__ << " = " << mt(__VA_ARGS__) \
                   << " [" << __LINE__ << "]\x1b[0m" << endl)
#else
#define dump(...)
#endif
void fastios(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    // #define endl '\n'
}
template<class T>
size_t uniq(vector<T> &v){
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    return v.size();
}
template<class T>
size_t uniq(T *l, size_t n){
    sort(l,l+n);
    return unique(l,l+n) - l;
}
#define mems(arr,val) memset(arr,val,sizeof(arr));
int const mod = 1000000007;
int const inf = numeric_limits<int>::max()/8;

template<class T>
class SqrtDecomp {
    //private:
public:
    const size_t B, _size;
    T const init;
    vector<T> b, a;
public:
    SqrtDecomp(const size_t size = 0,
               T const &init = numeric_limits<T>::max(),
               const size_t B = 150)
        : B(B), _size(size),
          init(init), b(size/B + 1, init), a(size, init){}

    size_t size() const {
        return _size;
    }

    T get(size_t l, const size_t &r) const {
        T res = numeric_limits<T>::max();
        while(l < r){
            if(l%B == 0 && l + B <= r){
                res = min(res, b[l/B]);
                l += B;
            } else {
                res = min(res, a[l]);
                l++;
            }
        }
        return res;
    }

    void set(const size_t &p, const T &x){
        a[p] = x, b[p/B] = init;
        size_t s = p/B, end = min(p - p%B + B, size());
        for(size_t i = p - p%B; i < end; i++){
            b[s] = min(b[s], a[i]);
        }
    }

    vector<T> to_a(int l = -1, int r = -1){
        if(l == -1) l = 0;
        if(r == -1) r = size();
        vector<T> res(r-l);
        for(int i = l; i < r; i++) res[i-l] = get(i,i+1);
        return res;
    }
};

vector<int> naive(int n, int q, const vi &a, const vi &b, const vi &c){
    vector<int> ans;
    vector<int> arr(n,(1LL<<31)-1);
    for(int i = 0; i < q; i++){
        if(a[i] == 0){
            arr[b[i]] = c[i];
        } else {
            int res = (1LL<<31)-1;
            for(int j = b[i]; j <= c[i]; j++){
                res = min(res,arr[j]);
            }
            ans.push_back(res);
        }
    }
    return ans;
}

vector<int> solve(int n, int q, const vi &a, const vi &b, const vi &c){
    vector<int> ans;
    SqrtDecomp<int32_t> rmq(n, (1LL<<31)-1);
    for(int i = 0; i < q; i++){
        if(a[i] == 0){
            rmq.set(b[i],c[i]);
        } else {
            ans.push_back(rmq.get(b[i],c[i]+1));
        }
    }
    return ans;
}

int main(){
    fastios();
    int n,q;
    cin >> n >> q;
    vector<int> a(q), b(q), c(q);
    rep(i,q) cin >> a[i] >> b[i] >> c[i];
    auto ans = solve(n,q,a,b,c);
    rep(i,ans.size()) cout << ans[i] << '\n';
}

Measured memory_bytes: 2992