#include<stdio.h>
#include<stdlib.h>
main()
{
        int i, n, q, com, x, y, count = 0;
        int *a, *min;
        scanf("%d %d", &n, &q);
        min = (int*)malloc(sizeof(int) * n);
        a = (int*)malloc(sizeof(int) * n);
        for(i = 0; i < n; i++){
                a[i] = 2147483647;
        }
        for(i = 0; i < q; i++){
                scanf("%d %d %d" , &com, &x, &y);
                switch(com){
                case 0:
                        a[x] = y;
                        break;
                case 1:
                        min[count] = a[x];
                        for(n = x + 1; n <= y; n++){
                                if(min[count] > a[n]){
                                        min[count] = a[n];
                                }
                        }
                        count++;
                        break;
                }
        }
        for(i = 0; i < count; i++){
                printf("%d\n", min[i]);
        }
        //printf("%p\n%p\n", a, min);
        //free(a);
        //free(min);
}