#include <iostream>
#include<vector>
#include<cstdio>
using namespace std;
class Set{
    public: vector<int> set;
    Set(int n){
        set.resize(n);
        for(int i = 0;i < n;++i){
            set[i] = (1 << 31) - 1;
        }
        
    }
    
    public: void update(int x,int y){
        set[x] = y;
    }
    
    public: int find(int s,int e){
        int min = (1 << 31) - 1;
        for(int i = s;i <= e;++i){
            if(set[i] < min) min = set[i];
        }
        return min;
    }
    
};

int main(void){
    int n,q,x,y,c;
    scanf("%d %d",&n,&q);
    Set set(n);
    for(int i = 0;i < q;++i){
        scanf("%d",&c) ;
        scanf("%d %d",&x,&y);
        if(c==0){
            set.update(x,y);
        }else{
            printf("%d\n",set.find(x,y));
        }
    }
    
}

