//#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, typename Operand>
class lazy_segment_tree {
	struct node {
		Monoid element;
		Operand lazy;
		bool h;
	};
	std::vector<node> tree;
	std::uint_fast32_t size, height;
	void assign(std::uint_fast32_t index, const Operand &data) {
		if (tree[index].h) tree[index].lazy = tree[index].lazy*data;
		else { tree[index].lazy = data;tree[index].h = 1; }
	}
	Monoid reflect(std::uint_fast32_t index) {
		if (tree[index].h) return tree[index].element*tree[index].lazy;
		return tree[index].element;
	}
	void recalc(std::uint_fast32_t index) {
		tree[index].element = reflect(index << 1) + reflect(index << 1 | 1);
	}
	void push(std::uint_fast32_t index) {
		if (!tree[index].h) return;
		assign(index << 1, tree[index].lazy);
		assign(index << 1 | 1, tree[index].lazy);
		tree[index].element = tree[index].element*tree[index].lazy;
		tree[index].h = 0;
	}
	void propagate(std::uint_fast32_t index) {
		std::uint_fast32_t i = height;
		do { push(index >> i); } while (--i);
	}
	void build(std::uint_fast32_t index) {
		while (index >>= 1)recalc(index);
	}
public:
	void update(std::uint_fast32_t begin, std::uint_fast32_t end, const Operand &data) {
		begin += size;
		end += size - 1;
		propagate(begin);
		propagate(end);
		for (std::uint_fast32_t left = begin, right = end + 1;left < right;left >>= 1, right >>= 1) {
			if (left & 1) assign(left++, data);
			if (right & 1) assign(--right, data);
		}
		build(begin);
		build(end);
	}
	Monoid range(std::uint_fast32_t begin, std::uint_fast32_t end) {
		begin += size;end += size;
		propagate(begin);
		propagate(end - 1);
		Monoid retL, retR;
		for (;begin < end;begin >>= 1, end >>= 1) {
			if (begin & 1) retL = retL + reflect(begin++);
			if (end & 1) retR = reflect(--end) + retR;
		}
		return retL + retR;
	}
	//trueを返す最小のインデックス
	std::uint_fast32_t binary_search(std::function<bool(Monoid)> bound) {
		if (!bound(reflect(1))) return size;
		Monoid ret;
		std::uint_fast32_t i = 1;
		while (i < size) {
			push(i);
			if (!bound(ret + reflect(i <<= 1))) ret = ret + reflect(i++);
		}
		return i - size;
	}
	lazy_segment_tree(std::uint_fast32_t length) :height(static_cast<std::uint_fast32_t>(0)) {
		--length;
		length |= length >> 1;
		length |= length >> 2;
		length |= length >> 4;
		length |= length >> 8;
		length |= length >> 16;
		if (!length) length = 1;
		height = __builtin_popcount(length);
		size = length + 1;
		tree = std::vector<node>(size << 1);
		initialize();
	}
	void update(std::uint_fast32_t index, std::function<Monoid(Monoid)> f) {
		index += size;
		propagate(index);
		if (tree[index].h) {
			tree[index].element = tree[index].element*tree[index].lazy;
			tree[index].h = 0;
		}
		tree[index].element = f(tree[index].element);
		build(index);
	}
	void initialize(void) {
		std::uint_fast32_t const s = size;
		std::uint_fast32_t i = s << 1;
		while (--i >= s) { tree[i].element = Monoid();tree[i].h = 0; }
		do { recalc(i);tree[i].h = 0; } while (--i);
	}
};

template<typename T>
struct MIN {
	T e;
	MIN(T x = std::numeric_limits<T>::max()) :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);
	lazy_segment_tree<M, M> T(n);
	T.update(0, n, M(2147483647));
	uint32 c, s, t;
	M x;
	while (q--) {
		uscan(c);uscan(s);uscan(t);
		if (c) {
			printf("%lu\n", T.range(s, t + 1).e);
		}
		else {
			uscan(x.e);
			T.update(s, t + 1, x);
		}
	}
	return 0;
}


Measured memory_bytes: 8864