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

int main() {
	vector<int> v; int n, q, c, x, y; cin >> n >> q;
	v.resize(n); fill(v.begin(), v.end(), INT_MAX);
	for (int i = 0; i < q; i++) {
		cin >> c >> x >> y;
		switch (c) {
		case 0:
			v[x] = y; break;
		case 1:
			auto itr = min_element(v.begin() + x, v.begin() + y + 1);
			cout << *itr << endl; break;
		}
	}
	return 0;
}
