#include <iostream>
#include <algorithm>
using namespace std;

const int N = 1 << 17;
const int INF = (1LL << 31LL) - 1;
int dat[2 * N - 1];
int n, q;

void init(int n_)
{
	n = 1;
	while(n_ > n)
		n *= 2;
	
	for(int i = 0; i < 2 * n - 1; ++i)
		dat[i] = INF;
}

void update(int k, int a)
{
	k += n - 1;
	dat[k] = a;
	
	while(k > 0){
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}

int query(int a, int b, int k, int l, int r)
{
	if(r <= a || b <= l)
		return INF;
	
	if(a <= l && r <= b)
		return dat[k];
	else {
		int vl = query(a, b, k * 2 + 1, l, (r + l) / 2);
		int vr = query(a, b, k * 2 + 2, (r + l) / 2, r);
		return min(vl, vr);
	}
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> n >> q;
	init(n);
	
	int com, x, y;
	for(int i = 0; i < q; ++i){
		cin >> com >> x >> y;
		if(com == 0)
			update(x, y);
		else {
			++y;
			cout << query(x, y, 0, 0, n) << endl;
		}
	}
	
	return 0;
}