#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	int n, q;
	scanf("%d %d", &n, &q);
	long A[100000];
	for (long i = 0; i < n; i++) A[i] = pow(2, 31) - 1;
	for (long i = 0; i < q; i++){
		long c, x, y;
		scanf("%ld %ld %ld", &c, &x, &y);
		if (c == 0) A[x] = y;
		else printf("%ld\n", *min_element(A + x, A + y + 1));
	}
	return 0;
}