#define NDEBUG
#include <cassert>
#include <cstdint>
#include <functional>
#include <vector>

template <typename Monoid> class SegmentTree {
	using uint32 = std::uint_fast32_t;
	using F = std::function<Monoid(const Monoid &, const Monoid &)>;
	const F f;
	const Monoid neutral_;
	const uint32 size_;
	std::vector<Monoid> tree;
	static uint32 getsize(const uint32 size) {
		uint32 ret = 1;
		while (ret < size)
			ret <<= 1;
		return ret;
	}
	void recalc(const uint32 index) {
		tree[index] = f(tree[index << 1], tree[index << 1 | 1]);
	}

public:
	SegmentTree(const uint32 size, const Monoid &neutral = Monoid(),
		const F &f = std::plus<Monoid>())
		: f(f), neutral_(neutral), size_(getsize(size)),
		tree(size_ << 1, neutral_) {}
	SegmentTree(const std::vector<Monoid> &arr, const Monoid &neutral = Monoid(),
		const F &f = std::plus<Monoid>())
		: f(f), neutral_(neutral), size_(getsize(arr.size())),
		tree(size_ << 1, neutral_) {
		for (uint32 i = 0; i < arr.size(); ++i)
			tree[size_ + i] = arr[i];
		for (uint32 i = size_; --i;)
			recalc(i);
	}
	void update(uint32 index, const std::function<void(Monoid &)> &g) {
		assert(index < size_);
		g(tree[index += size_]);
		while (index >>= 1)
			recalc(index);
	}
	void update(uint32 index, const Monoid &data) {
		update(index, [&](Monoid &e) {e = data;});
	}
	Monoid range(uint32 begin, uint32 end) const {
		assert(begin <= end);
		assert(begin <= size_);
		assert(end <= size_);
		Monoid retL = neutral_, retR = neutral_;
		for (begin += size_, end += size_; begin < end; begin >>= 1, end >>= 1) {
			if (begin & 1)
				retL = f(retL, tree[begin++]);
			if (end & 1)
				retR = f(tree[end - 1], retR);
		}
		return f(retL, retR);
	}
	const Monoid &operator[](const uint32 index) const {
		assert(index < size_);
		return tree[index + size_];
	}
};
#include<iostream>
#include<algorithm>
#include<cstdio>
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
template<typename T>auto scan(T&d)->typename std::enable_if<std::is_signed<T>::value>::type
{
	d = 0;int c = fgetc(stdin);bool f = 0;while (c<'0' || '9'<c) { if (c == '-')f = 1;c = fgetc(stdin); }
	while (c != ' '&&c != '\n') { d = d * 10 + c - '0';c = fgetc(stdin); }if (f)d = -d;
}
template<typename T>auto scan(T&d)->typename std::enable_if<!std::is_signed<T>::value>::type
{
	d = 0;int c = fgetc(stdin);while (c == ' ' || c == '\n')c = fgetc(stdin);
	while (c != ' '&&c != '\n') { d = d * 10 + c - '0';c = fgetc(stdin); }
}
void scan(char&d) { d = fgetc(stdin);while (d == ' ' || d == '\n')d = fgetc(stdin); }
void scan(double&d) { scanf("%lf", &d); }void scan(std::string&d) {
	d.clear();int c = fgetc(stdin);
	while (c == ' ' || c == '\n')c = fgetc(stdin);while (c != ' '&&c != '\n') { d.push_back(c);c = fgetc(stdin); }
}
template<typename F, typename...R>void scan(F&f, R&...r) { scan(f);scan(r...); }
template<typename T>T input() { T d;scan(d);return d; }
template <typename T>auto print(T d)->typename std::enable_if<std::is_signed<T>::value>::type
{
	static int c[20];int i = 0;bool f = 0;if (d<0) { f = 1;d = -d; }while (d) { c[i++] = d % 10;d /= 10; }
	if (!i)c[i++] = 0;if (f)fputc('-', stdout);while (i--)fputc(c[i] + '0', stdout);
}
template<typename T>auto print(T d)->typename std::enable_if<!std::is_signed<T>::value>::type
{
	static int c[20];int i = 0;while (d) { c[i++] = d % 10;d /= 10; }
	if (!i)c[i++] = 0;while (i--)fputc(c[i] + '0', stdout);
}
template<>void print<char>(char d) { fputc(d, stdout); }
template<>void print<double>(double d) { printf("%f", d); }
template<>void print<char *>(char *c) { while (*c != '\0')fputc(*(c++), stdout); }void print() {}
template<typename F, typename...R>void print(F f, R...r) { print(f);print(r...); }
template<typename...R>void println(R...r) { print(r...);fputc('\n', stdout); }
template<typename...R>int END(R...r) { println(r...);return 0; }
int main(void) {
	int n, q;
	scan(n, q);
	SegmentTree<int> T(n, 2147483647, [](int l, int r) {return std::min(l, r);});
	while (q--) {
		int c, x, y;
		scan(c, x, y);
		if (c) {
			println(T.range(x, y + 1));
		}
		else {
			T.update(x, y);
		}
	}
	return 0;
}


Measured memory_bytes: 3792