

#include "bits/stdc++.h"
#include <array>
using namespace std;

struct SgTree{
private:
	vector<pair<long long, bool>> node;
	long long defval;
	int N;
	int n;
public:
	void init(int n, long long defval = INT64_MAX){
		N = 1;
		while(N < n)N<<=1;
		this->n = n;
		this->defval = defval;
		node.assign(N*2-1, make_pair(defval, false));
	}
	long long query(int a, int b, int l = 0, int r = -1, int i = 0){
		if(r == -1) r = N;
		if(b <= l || r <= a) return defval;
		if(a <= l && r <= b) return node[i].first;
		if(node[i].second) return node[i].first;
		return min(query(a,b,l,(l+r)/2,i*2+1),query(a,b,(l+r)/2,r,i*2+2));
	}
	void update2(int a, int b, long long v, int l, int r, int i, long long defv){
		if(b <= l || r <= a) { node[i] = make_pair(defv, true); return; }
		if(a <= l && r <= b) { node[i] = make_pair(v, true); return; }
		
		update2(a,b,v,l,(l+r)/2,i*2+1,defv);
		update2(a,b,v,(l+r)/2,r,i*2+2,defv);

		node[i].second = false;
		node[i].first = min(node[i*2+1].first, node[i*2+2].first);
	}
	void update(int a, int b, long long v, int l = 0, int r = -1, int i = 0){
		if(r == -1) r = N;
		if(b <= l || r <= a) return;
		if(a <= l && r <= b) { node[i] = make_pair(v, true); return; }
		if(node[i].second) return update2(a,b,v,l,r,i,node[i].first);
		
		update(a,b,v,l,(l+r)/2,i*2+1);
		update(a,b,v,(l+r)/2,r,i*2+2);

		node[i].first = min(node[i*2+1].first, node[i*2+2].first);
	}

};


int main() {
	int n, q; cin >> n >> q;
	SgTree tr; tr.init(n, INT_MAX);

	vector<long long> ans;

	for(int i = 0; i < q; i++){
		int c; cin >> c;
		if(c == 0){
			int s,t,x; cin >> s >> t >> x;
			tr.update(s, t+1, x);
		}
		else {
			int s, t; cin >> s >> t;
			ans.push_back(tr.query(s, t+1));
		}
	}

	for(int i = 0; i < ans.size(); i++){
		cout << ans[i] << endl;
	}

    return 0;
}

