#include <stdio.h>

#define N_MAX 100000
#define Q_MAX 100000
#define A_MAX 0x7FFFFFFF

typedef unsigned int    uint;
typedef unsigned short  ushort;

typedef struct{
    ushort  com;
    uint    x;
    uint    y;
}Querie;

void update(uint *a, uint x, uint y);
uint find(uint *a, uint x, uint y);

int main(void)
{
    uint    n, q, ii;
    uint    a[N_MAX];
    Querie  que[Q_MAX];
    
    scanf("%d %d", &n, &q);
    
    for(ii = 0; ii < n; ii++){
        a[ii] = A_MAX;
    }
    
    for(ii = 0; ii < q; ii++){
        scanf("%d %d %d", &(que[ii].com), &(que[ii].x), &(que[ii].y));
    }
    
    for(ii = 0; ii < q; ii++){
        switch(que[ii].com){
        case 1:
            printf("%d\n", find(a, que[ii].x, que[ii].y));
            break;
        case 0:
            update(a, que[ii].x, que[ii].y);
            break;
        default:
            break;
        }
    }

    return 0;
}

void update(uint *a, uint x, uint y)
{
    a[x] = y;
}

uint find(uint *a, uint x, uint y)
{
    uint    min = a[x];
    uint    ii;
    
    if(x > y){
        for(ii = y; ii <= x; ii++){
            if(min > a[ii]){
                min = a[ii];
            }
        }
    }else{
        for(ii = x; ii <= y; ii++){
            if(min > a[ii]){
                min = a[ii];
            }
        }
    }
    
    return min;
}
