#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define ALL(x) (x).begin(),(x).end()
#define C(x) cout << #x << ":" << x<<" "
#define scanf scanf_s

using int32 = int_fast32_t;
using int64 = int_fast64_t;
using uint32 = uint_fast32_t;
using uint64 = uint_fast64_t;

using namespace std;

template<typename Monoid, typename Operand>
class SegTree {
public:
	Monoid* tree;
	Operand* calc;
	bool* lazy;
	size_t size;
	int32 i;
	size_t hight = 0;
	//?????????????????????
	SegTree(size_t length) {
		--length;
		size = length;
		if (size & 0xffff0000) { size = size & 0xffff0000;hight += 16; }
		if (size & 0xff00ff00) { size = size & 0xff00ff00;hight += 8; }
		if (size & 0xf0f0f0f0) { size = size & 0xf0f0f0f0;hight += 4; }
		if (size & 0xcccccccc) { size = size & 0xcccccccc;hight += 2; }
		if (size & 0xaaaaaaaa) { size = size & 0xaaaaaaaa;hight += 1; }
		if (length) { size <<= 1;hight += 1; }
		else { size = 1;hight = 0; }
		tree = (Monoid *)calloc(size << 1, sizeof(Monoid));
		calc = (Operand *)calloc(size << 1, sizeof(Operand));
		lazy = (bool *)calloc(size << 1, sizeof(bool));
	}
	//?????????
	void set() {
		size <<= 1;
		for (i = 0;i < size;++i) {
			tree[i].set();
			calc[i].set();
			lazy[i] = false;
		}
		size >>= 1;
	}
	//calc[begin,end)???data???????????????????¨????
	void update(size_t begin, size_t end, Operand &data) {
		begin += size;
		end += size - 1;
		size_t left, right;
		for (i = hight;i > 0;--i) {
			left = begin >> i;
			right = end >> i;
			if (lazy[left]) {
				if (lazy[left << 1]) {
					calc[left << 1] = calc[left << 1] * calc[left];
				}
				else {
					calc[left << 1] = calc[left];
					lazy[left << 1] = true;
				}
				if (lazy[left << 1|1]) {
					calc[left << 1|1] = calc[left << 1|1] * calc[left];
				}
				else {
					calc[left << 1|1] = calc[left];
					lazy[left << 1 | 1] = true;
				}
				lazy[left] = false;
			}
			if (lazy[right]) {
				if (lazy[right << 1]) {
					calc[right << 1] = calc[right << 1] * calc[right];
				}
				else {
					calc[right << 1] = calc[right];
					lazy[right << 1] = true;
				}
				if (lazy[right << 1 | 1]) {
					calc[right << 1 | 1] = calc[right << 1 | 1] * calc[right];
				}
				else {
					calc[right << 1 | 1] = calc[right];
					lazy[right << 1 | 1] = true;
				}
				lazy[right] = false; 
			}
		}
		for (left = begin, right = end + 1;left < right;left >>= 1, right >>= 1) {
			if (left & 1) {
				if (lazy[left]) {
					calc[left] = calc[left] * data;
				}
				else {
					calc[left] = data;
					lazy[left] = true;
				}
				++left;
			}
			if (right & 1) {
				--right;
				if (lazy[right]) {
					calc[right] = calc[right] * data;
				}
				else {
					calc[right] = data;
					lazy[right] = true;
				}
			}
		}
		for (begin >>= 1, end >>= 1;begin < end;begin >>= 1, end >>= 1) {
			tree[begin] = (lazy[begin<<1] ? tree[begin <<1] * calc[begin <<1] : tree[begin <<1]) + (lazy[begin <<1|1] ? tree[begin <<1|1] * calc[begin <<1|1] : tree[begin <<1|1]);
			tree[end] = (lazy[end << 1] ? tree[end << 1] * calc[end << 1] : tree[end << 1]) + (lazy[end << 1 | 1] ? tree[end << 1 | 1] * calc[end << 1 | 1] : tree[end << 1 | 1]);
		}
		for (;begin;begin >>= 1) {
			tree[begin] = (lazy[begin << 1] ? tree[begin << 1] * calc[begin << 1] : tree[begin << 1]) + (lazy[begin << 1 | 1] ? tree[begin << 1 | 1] * calc[begin << 1 | 1] : tree[begin << 1 | 1]);
		}
	}
	//[begin,end)??????????????????
	Monoid range(size_t begin, size_t end) {
		Monoid retL, retR;
		begin += size;end += size - 1;
		size_t left, right;
		for (i = hight;i > 0;--i) {
			left = begin >> i;
			right = end >> i;
			if (lazy[left]) {
				if (lazy[left << 1]) {
					calc[left << 1] = calc[left << 1] * calc[left];
				}
				else {
					calc[left << 1] = calc[left];
					lazy[left << 1] = true;
				}
				if (lazy[left << 1 | 1]) {
					calc[left << 1 | 1] = calc[left << 1 | 1] * calc[left];
				}
				else {
					calc[left << 1 | 1] = calc[left];
					lazy[left << 1 | 1] = true;
				}
				tree[left] = tree[left] * calc[left];
				lazy[left] = false;
			}
			if (lazy[right]) {
				if (lazy[right << 1]) {
					calc[right << 1] = calc[right << 1] * calc[right];
				}
				else {
					calc[right << 1] = calc[right];
					lazy[right << 1] = true;
				}
				if (lazy[right << 1 | 1]) {
					calc[right << 1 | 1] = calc[right << 1 | 1] * calc[right];
				}
				else {
					calc[right << 1 | 1] = calc[right];
					lazy[right << 1 | 1] = true;
				}
				tree[right] = tree[right] * calc[right];
				lazy[right] = false;
			}
		}
		++end;
		for (;begin < end;(++begin) >>= 1, end >>= 1) {
			if (begin & 1) {
				if (lazy[begin]) { retL = retL + (tree[begin] * calc[begin]); }
				else { retL = retL + tree[begin]; }
			}
			if (end & 1) {
				if (lazy[--end]) { retR = retR + (tree[end] * calc[end]); }
				else { retR = retR + tree[end]; }
			}
		}
		return retL + retR;
	}
};

struct MIN {
	int32 e;
	MIN() { set(); }
	MIN(int32 x) { e = x; }
	void set() { e = 2147483647; }
	MIN operator+(const MIN &other) {
		return e < other.e ? MIN(e) : MIN(other.e);
	}
	MIN operator*(const MIN &other) {
		return other;
	}
};

class ch {
public:
	int32 tree[8];
	ch() {
		rep(i, 0, 8) {
			tree[i] = 2147483647;
		}
	}
	void update(int32 begin, int32 end, int32 data) {
		rep(i, begin, end) {
			tree[i] = data;
		}
	}
	int32 range(int32 begin, int32 end) {
		int32 ret = 2147483647;
		rep(i, begin, end) {
			ret = min(ret, tree[i]);
		}
		return ret;
	}
};

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

	size_t n, q;
	cin >> n >> q;
	SegTree<MIN, MIN> t(n);
	t.set();
	/*
	int a[10] = { 1,6,34,6,8,8,4,2,21,7 };
	int b[10] = { 1,5,5,3,4,2,5,6,6,0 };
	int c[10] = { 3,7,6,6,8,6,8,8,7,2 };
	*/
	bool c;
	size_t x, y;
	MIN z;
	rep(i, 0, q) {
		cin >> c;
		if (c) {
			cin >> x >> y;

			printf("%d\n", t.range(x, y + 1).e);
		}
		else {
			cin >> x >> y >> z.e;
			t.update(x, y + 1, z);

		}
	}
	/*
	rep(i, 1, 8) {
	C(t.tree[i].e);
	C(t.calc[i].e);
	C(t.lazy[i]);
	cout << endl;
	}
	*/
	return 0;
}

Measured memory_bytes: 7588