#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

using namespace std;

const long long _MOD = 1000000007;
const long long MOD = 998244353;

template <typename T>
class segmentTree {
private:
	T* tree;
	T paddingObj;
	std::function<T(T, T)> segfunc;
	int treeSize;
	int treeHeight;

	void initialize() {
		for (int i = treeHeight - 1; i >= 1; --i) {
			for (int counter = 0; counter < (1 << (i - 1)); ++counter) {
				int index = (1 << (i - 1)) - 1 + counter;
				tree[(1 << (i - 1)) - 1 + counter] = segfunc(tree[index*2+1], tree[index*2+2]);
			}
		}
	}

	void updateTree(int index) {
		if (index == 0) return;

		if (index % 2 == 0) --index;
		tree[(index - 1) / 2] = segfunc(tree[index], tree[index + 1]);
		updateTree((index - 1) / 2);
	}

	T query(int l, int r, int left, int right, int index) {
		if (l <= left && r >= right) {
			return tree[index];
		}
		else if (l > right || r < left) {
			return paddingObj;
		}
		else {
			return segfunc(query(l, r, left, (left + right) / 2, index * 2 + 1), query(l, r, (left + right) / 2 + 1, right, index * 2 + 2));
		}
	}
public:
	segmentTree(T *originalArray, int arraySize, T paddingObj, std::function<T(T, T)> func) {
		this->segfunc = func;
		this->paddingObj = paddingObj;

		treeHeight = 1;
		while ((1 << (treeHeight - 1)) < arraySize) ++treeHeight;
		treeSize = 1 << (treeHeight - 1);
		tree = new T[treeSize * 2 - 1];
		for (int i = 0; i < arraySize; ++i) tree[(treeSize - 1) + i] = originalArray[i];
		for (int i = arraySize; i < treeSize; ++i) tree[(treeSize - 1) + i] = paddingObj;

		initialize();
	}

	~segmentTree() {
		delete[] tree;
	}

	void update(int index, T x) {
		if (index >= treeSize || index < 0) {
			throw std::out_of_range("Index must be in [0, treeSize)");
			return;
		}

		tree[treeSize - 1 + index] = x;
		updateTree(treeSize - 1 + index);
	}

	T get(int l, int r) {
		if (l > r || l < 0 || r >= treeSize) {
			throw std::out_of_range("Both l and r must be in [0, treeSize) and l must be greater than r");
		}

		return query(l, r, 0, treeSize - 1, 0);
	}
};

ll solve(ll x, ll y) {
	return min(x, y);
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, q;
	cin >> n >> q;
	ll* a = new ll[n];
	ll num = 1;
	num = num << 31;
	--num;
	rep(i, n) a[i] = num;

	segmentTree<ll> segtree(a, n, num, solve);

	rep(i, q) {
		ll com, x, y;
		cin >> com >> x >> y;

		if (com == 0) {
			segtree.update(x, y);
		}
		else {
			cout << segtree.get(x, y) << "\n";
		}
	}

	return 0;
}



Measured memory_bytes: 5664