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

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



template<typename Monoid, typename Operand>
class lazy_segment_tree {
	struct node {
		Monoid element;
		Operand lazy;
		bool h;
		node() :h(0) {}
	};
	std::vector<node> tree;
	uint32 size, height;
	void assign(uint32 index, const Operand &data) {
		if (tree[index].h) {tree[index].lazy = tree[index].lazy*data;}
		else {tree[index].lazy = data;tree[index].h = 1;}
		return;
	}
	Monoid reflect(uint32 index) {
		if (tree[index].h) return tree[index].element*tree[index].lazy;
		return tree[index].element;
	}
	void recalc(uint32 index) {
		tree[index].element = reflect(index << 1) + reflect(index << 1 | 1);
	}
	void push(uint32 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;
		return;
	}
	void propagate(uint32 left, uint32 right) {
		uint32 i = height;
		do {
			push(left >> i);
			push(right >> i);
		} while (--i);
		return;
	}
public:
	void update(uint32 begin, uint32 end, const Operand &data) {
		begin += size;
		end += size - 1;
		propagate(begin, end);
		for (uint32 left = begin, right = end + 1;left < right;left >>= 1, right >>= 1) {
			if (left & 1) {
				assign(left++, data);
			}
			if (right & 1) {
				assign(--right, data);
			}
		}
		uint32 i = height;
		do {
			recalc(begin >>= 1);
			recalc(end >>= 1);
		} while (--i);
		return;
	}
	Monoid range(uint32 begin, uint32 end) {
		Monoid retL, retR;
		begin += size;end += size;
		propagate(begin, end - 1);
		for (;begin < end;begin >>= 1, end >>= 1) {
			if (begin & 1) {
				retL = retL + reflect(begin++);
			}
			if (end & 1) {
				retR = reflect(--end) + retR;
			}
		}
		return retL + retR;
	}
	lazy_segment_tree(uint32 length) :height(static_cast<uint32>(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);
	}
	void set(void) {
		uint32 const s = size;
		uint32 i = s << 1;
		while (--i >= s) {
			tree[i].element.set();
			tree[i].h = 0;
		}
		do {
			tree[i].element = tree[i << 1].element + tree[i << 1 | 1].element;
			tree[i].h = 0;
		} while (--i);
		return;
	}
};
struct MIN {
	int32 e;
	MIN(int32 x = ((int32)1 << 31) - 1) { e = x; }
	void set() { e = std::numeric_limits<int32>::max(); }
	void reverse(void) {}
	MIN operator+(const MIN &other) {
		if (e < other.e) return *this;
		return other;
	};
	MIN operator*(const MIN &other) {
		return other;
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	uint32 n, q;
	std::cin >> n >> q;
	lazy_segment_tree<MIN, MIN> T(n);
	uint32 c, s, t, x;
	do {
		std::cin >> c >> s >> t;
		if (c) {
			std::cout << T.range(s, t + 1).e << "\n";
		}
		else {
			std::cin >> x;
			T.update(s, t + 1, MIN(x));
		}
	} while (--q);
	return 0;
}


Measured memory_bytes: 8884