#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<complex>
  
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
  
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
 

class RMQ{
    private:
        ll *st;
        static const ll INF = 1000000000000000; 
        ll N;
        ll recursion_max(int i,int a,int b,int p,int q){//[a,b) [p,q)
            if(a <= p && q <= b)
                return st[i];
            if(b <= p || q <= a)
                return -INF;
  
            return max(recursion_max(i * 2,a,b,p,(p + q) / 2),recursion_max(i * 2 + 1,a,b,(p + q) / 2,q));
        }
  
    public: 
        RMQ(int n){
            N = 1;
            while(N < n)
                N *= 2;
            st = (ll*)malloc(N * 2 * sizeof(ll));
            REP(i,N * 2)
                st[i + 1] = -INF;
        }
  
        ll range_max(int a,int b){
            if(a > b)
                swap(a,b);
  
            if(a < 0)
                a = 0;
            if(b > N)
                b = N - 1;
  
            return recursion_max(1,a,b,0,N);
        }
  
        void update(ll a,int i){
            i += N;
            st[i] = a;
            i /= 2;
  
            while(i > 0){
                st[i] = max(st[i * 2],st[i * 2 + 1]);
                i /= 2;
            }
        }
 
        void print(){
            FOR(i,1,N * 2){
                if(__builtin_popcountll(i) == 1){
                    printf("\n");
                }
                printf("%lld ",st[i]);
            }
        }
  
        ~RMQ(){
            free(st);
        }
}; 

class RmQ{
    private:
        ll *st;
        static const ll INF = 1000000000000000; 
        ll N;
        ll recursion_min(int i,int a,int b,int p,int q){//[a,b) [p,q)
            if(a <= p && q <= b)
                return st[i];
            if(b <= p || q <= a)
                return INF;
  
            return min(recursion_min(i * 2,a,b,p,(p + q) / 2),recursion_min(i * 2 + 1,a,b,(p + q) / 2,q));
        }
  
    public: 
        RmQ(int n){
            N = 1;
            while(N < n)
                N *= 2;
            st = (ll*)malloc(N * 2 * sizeof(ll));
            REP(i,N * 2)
                st[i + 1] = INF;
        }
  
        ll range_min(int a,int b){
            if(a > b)
                swap(a,b);
  
            if(a < 0)
                a = 0;
            if(b > N)
                b = N - 1;
  
            return recursion_min(1,a,b,0,N);
        }
  
        void update(ll a,int i){
            i += N;
            st[i] = a;
            i /= 2;
  
            while(i > 0){
                st[i] = min(st[i * 2],st[i * 2 + 1]);
                i /= 2;
            }
        }
 
        void print(){
            FOR(i,1,N * 2){
                if(__builtin_popcountll(i) == 1){
                    printf("\n");
                }
                printf("%lld ",st[i]);
            }
        }
  
        ~RmQ(){
            free(st);
        }
};
  
int main(void){
   
    ll n,q;
    scanf("%lld%lld",&n,&q);
   
    RMQ a(n);
   
    REP(i,n){
        a.update(-((1 << 31) - 1),i);
    }
   
    REP(i,q){
        ll com,x,y;
        scanf("%lld%lld%lld",&com,&x,&y);
   
        if(com == 0)
            a.update(-y,x);
        else{
            printf("%lld\n",-a.range_max(x,y + 1));
        }
    }
    return 0;
}

Measured memory_bytes: 4932