//#define NDEBUG
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
static constexpr double PI = 3.1415926535897932;

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;

template<typename T>
void uscan(T &d) {
	d = 0;unsigned char c = 0;
	while (c < '0' || '9' < c) c = fgetc(stdin);
	while ('0' <= c&&c <= '9') {
		d = (d << 3) + (d << 1) + c - '0';c = fgetc(stdin);
	}
}
template<typename T>
void scan(T &d) {
	d = 0;unsigned char c = 0;bool f = 0;
	while (c < '0' || '9' < c) {
		if (c == '-') f = 1;c = fgetc(stdin);
	}
	while ('0' <= c&&c <= '9') {
		d = (d << 3) + (d << 1) + c - '0';c = fgetc(stdin);
	}
	if (f) d = -d;
}
template<>
void scan(double &d) { scanf("%lf", &d); }

#ifndef __GNUC__
std::uint_fast32_t __builtin_popcount(std::uint_fast32_t c) {
	c = (c & 0x55555555) + ((c >> 1) & 0x55555555);
	c = (c & 0x33333333) + ((c >> 2) & 0x33333333);
	c = (c + (c >> 4)) & 0x0F0F0F0F;
	c += c >> 8;
	c += c >> 16;
	return c & 0x3F;
}
#endif

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)const {
		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];
	}
};

template<typename T>
struct MIN {
	T e;
	MIN(T x = 2147483647) :e(x) {}
	MIN operator~() {
		return *this;
	}
	MIN operator+(const MIN &other)const {
		if (e < other.e) return *this;
		return other;
	};
	MIN operator*(const MIN &other)const {
		return other;
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	using M = MIN<uint32>;
	uint32 n, q;
	uscan(n);uscan(q);
	segment_tree<M> T(n);
	uint32 c, s, t;
	M x;
	while (q--) {
		uscan(c);uscan(s);
		if (c) {
			uscan(t);
			printf("%lu\n", T.range(s, t + 1).e);
		}
		else {
			uscan(x.e);
			T.update(s, [&](const M &t)->M {return x;});
		}
	}
	return 0;
}


Measured memory_bytes: 4904