#include <stdio.h>
#define INF (1<<31)-1
#define N 100000
#define MIN(a,b) ((a<b)?(a):(b))

int A[N];

int search(int a,int b){
        int min=A[a];
        int i;
        for(i=a+1;i<=b;i++){
                min=MIN(min,A[i]);
        }
        return min;
}

int main(void){
        int min;
        int n,q;
        int c,x,y;
        int i;

        scanf("%d %d",&n,&q);
        for(i=0;i<n;i++) A[i]=INF;
        while(q--){
                scanf("%d %d %d",&c,&x,&y);
                if(c==0){ // update
                        A[x]=y;
                }else{ //find
                        printf("%d\n",search(x,y));
                }
        }
        return 0;

}