#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <climits>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <type_traits>
#include <utility>
#include <vector>

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;
using intl32 = std::int_least32_t;
using intl64 = std::int_least64_t;
using uintl32 = std::uint_least32_t;
using uintl64 = std::uint_least64_t;




struct ADD {
	int64 e;
	ADD(int64 x = 0) { e = x; }
	ADD operator*(const ADD &other) {
		return ADD(e + other.e);
	}
};
struct MIN {
	int64 e;
	MIN(int64 x = 2147483647) { e = x; }
	MIN operator~() {
		return *this;
	}
	MIN operator+(const MIN &other) {
		if (e < other.e) return *this;
		return other;
	};
	MIN operator*(const MIN &other) {
		return other;
	}
	MIN operator*(const ADD &other) {
		return MIN(e + other.e);
	}
};
struct MAX {
	int64 e;
	MAX(int64 x = std::numeric_limits<int64>::min()) { e = x; }
	MAX operator~() {
		return *this;
	}
	MAX operator+(const MAX &other) {
		if (e > other.e) return *this;
		return other;
	};
	MAX operator*(const MAX &other) {
		return other;
	}
	MAX operator*(const ADD &other) {
		return MAX(e + other.e);
	}
};
struct SUM {
	int64 e;
	int64 s;
	SUM(int64 x = 0, int64 y = 1) { e = x;s = y; }
	SUM operator~() {
		return *this;
	}
	SUM operator+(const SUM &other) {
		return  SUM(e + other.e, s + other.s);
	};
	SUM operator*(const SUM &other) {
		return SUM(s*other.e, s);
	}
	SUM operator*(const ADD &other) {
		return SUM(e + s*other.e, s);
	}
};

template<typename Monoid>
class segment_tree {
	std::vector<Monoid> tree;
	std::uint_fast32_t size;
public:
	segment_tree(std::uint_fast32_t length) {
		size = length - 1;
		size |= size >> 1;
		size |= size >> 2;
		size |= size >> 4;
		size |= size >> 8;
		size |= size >> 16;
		++size;
		tree = std::vector<Monoid>(size << 1);
		initialize();
	}
	void initialize() {
		std::uint_fast32_t i = size << 1;
		while (size < i--) { tree[i] = Monoid(); }
		++i;
		while (--i) { tree[i] = tree[i << 1] + tree[i << 1 | 1]; }
	}
	void update(std::uint_fast32_t index,std::function<Monoid(Monoid)> F) {
		index += size;
		tree[index] = F(tree[index]);
		while (index >>= 1) tree[index] = tree[index << 1] + tree[index << 1 | 1];
	}
	Monoid range(std::uint_fast32_t begin, std::uint_fast32_t end) {
		Monoid retL, retR;
		for (begin += size, end += size;begin < end;begin >>= 1, end >>= 1) {
			if (begin & 1) retL = retL + tree[begin++];
			if (end & 1)  retR = tree[end - 1] + retR;
		}
		return retL + retR;
	}
	Monoid operator[](std::uint_fast32_t index) {
		return tree[size + index];
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	uint32 n, q;
	std::cin >> n >> q;
	segment_tree<MIN> T(n);
	uint32 c, s, t;
	std::function<MIN(MIN, uint32)> F = [](const MIN &m, uint32 x)->MIN {
		return MIN((int64)x);
	};
	do {
		std::cin >> c >> s >> t;
		if (c) {
			std::cout << T.range(s, t + 1).e << "\n";
		}
		else {
			T.update(s, std::bind(F, std::placeholders::_1, t));
		}
	} while (--q);
	return 0;
}



Measured memory_bytes: 4940