#include <stdio.h>
#include <math.h>
#define MAX_N 100001
#define MAX_Q 100001

int LARGE_N;
int a[MAX_N*2];
int item_n;

void init(){
    int i;
    for(i = 1; i <= MAX_N*2; i++){
        a[i] = LARGE_N;
    }
}

void update(int i, int x){
    i = item_n - 1 + i;
    a[i] = x;
    while(i/2 > 0){
        if(a[i/2] > a[i]){
            a[i/2] = x;
            i = i/2;
        }
        else break;
    }
}

int find(int s, int t, int ts, int tt, int i){
    // printf("%d %d %d %d %d\n", s, t, ts, tt, i);
    if(s <= ts && t >= tt) return a[i];
    else if(s < ts && t < ts) return LARGE_N;
    else if(s > tt && t > tt) return LARGE_N;
    else {
        int l, r;
        l = find(s, t, ts, (ts+tt)/2, i*2);
        r = find(s, t, (ts+tt)/2+1, tt, i*2+1);
        if(l < r) return l;
        else return r;
    }
}

void printA(int n){
    int i;
    for(i = 1; i <= 2*n; i++) printf("%d, ", a[i]);
    printf("\n");
}

int main(void){
    LARGE_N = pow(2, 31)-1;
    // printf("%d\n", LARGE_N);
    init();
     
    int n, q;
    scanf("%d %d%*c", &n, &q);
    
    int depth = (int)(log((double)n)/log(2.0));
    item_n = pow(2.0, (double)depth+1);

    // printf("itemn: %d\n", item_n);

    int i, j, k;
    
    for(i = 0; i < q; i++){
        int com, x, y;
        scanf("%d %d %d%*c", &com, &x, &y);           
        
        if(com == 0) update(x+1, y);
        else printf("%d\n", find(x+1, y+1, 1, item_n, 1));
    }
    
    // printA(n);

    return 0;
}