#include <iostream>
#include <climits>

struct Node {
	int key;
	int lazy;
	Node() {}
};

void eval(Node* segtree, int index, int l, int r)
{
	if (segtree[index].lazy < INT_MAX) {
		segtree[index].key = segtree[index].lazy;
		if (l+1 < r) {
			segtree[2*index+1].lazy = segtree[index].lazy;
			segtree[2*index+2].lazy = segtree[index].lazy;
		}
		segtree[index].lazy = INT_MAX;
	}
}

void update(Node* segtree, int s, int t, int x, int l, int r, int index, int time)
{
	eval(segtree, index, l, r);
	
	if (t<l || r<=s) return;
	else if (s<=l && r<=t+1) {
		//segtree[index].key = x;
		segtree[index].lazy = x;
		eval(segtree, index, l, r);
	}
	else {
		int mid = (l + r) / 2;
		update(segtree, s, t, x, l, mid, 2*index+1, time);
		update(segtree, s, t, x, mid, r, 2*index+2, time);
		segtree[index].key = std::min(segtree[2*index+1].key, segtree[2*index+2].key);
	}
}

int find(Node* segtree, int s, int t, int l, int r, int index)
{
	if (t<l || r<=s) return INT_MAX;
	
	eval(segtree, index, l, r);
	
	if (s<=l && r<=t+1) {
		return segtree[index].key;
	}
	else {
		int mid = (l + r) / 2;
		int x = find(segtree, s, t, l, mid, 2*index+1);
		int y = find(segtree, s, t, mid, r, 2*index+2);
		return std::min(x, y);
	}
}

int main()
{
	int n; std::cin >> n;
	int seg_size = 1;
	for (; seg_size < n; seg_size<<=1);
	Node* segtree = new Node[2*seg_size-1];
	for (int i=0; i<2*seg_size-1; i++) {
		segtree[i].key = INT_MAX;
		segtree[i].lazy = INT_MAX;
	}
	
	int q; std::cin >> q;
	for (int i=0; i<q; i++) {
		int op, s, t, x;
		std::cin >> op;
		if (op==0) {
			std::cin >> s >> t >> x;
			update(segtree, s, t, x, 0, seg_size, 0, i);
		}
		else {
			std::cin >> s >> t;
			std::cout << find(segtree, s, t, 0, seg_size, 0) << std::endl;
		}
	}
	delete[] segtree;
	return 0;
}
	

