#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>

using namespace std;


/* Utils */

inline bool curSegmInQuerySegm (size_t query_l, size_t query_r, size_t cur_l, size_t cur_r) {
	return (query_l <= cur_l && cur_r <= query_r);
}

inline bool curSegmOutQuerySegm (size_t query_l, size_t query_r, size_t cur_l, size_t cur_r) {
	return (cur_r < query_l || query_r < cur_l);
}


/* Segment Tree Class */

class SegmentTree {
	private:
		struct Node {
			size_t left;
			size_t right;
			Node* left_tree;
			Node* right_tree;
			int minimum;
			bool isUpd;
			int upd;
		
			Node(size_t left, size_t right, int minimum = 0) {
				this->left = left;
				this->right = right;
				this->left_tree = nullptr;
				this->right_tree = nullptr;
				this->minimum = minimum;
				this->isUpd = false;
				this->upd = 0;
			}

			void push ();
		} *root;
	
		const int neutral = 2147483647;
		vector<int> arr;

		int buildTree (Node *node);
		int minOnSubsegment (size_t l, size_t r, Node *node);
		void updateOnSubsegment (size_t l, size_t r, int value, Node *node);
	
	public:
		SegmentTree (const vector<int> &arr);
		int RMQ (size_t l, size_t r);
		void RUQ (size_t l, size_t r, int minimum);

		void print (Node *node = nullptr) {
			if (node == nullptr)
				node = root;

			if (node->left_tree)
				print(node->left_tree);

			if (node->right_tree)
				print(node->right_tree);
		}

		void getArray () {
			for(int i = 0; i < arr.size(); i ++)
				cout << RMQ(i, i) << " ";

			cout << endl;
		}
};


/* Main methods: */

SegmentTree::SegmentTree(const vector<int> &arr) {
	this->arr = arr;
	root = new Node(0, arr.size() - 1);
	buildTree(root);
}

int SegmentTree::buildTree(Node *node) {
	if (node->left == node->right) {
		node->left_tree = nullptr; //На всякий случай
		node->right_tree = nullptr; //На всякий случай
		return node->minimum = arr[node->left];
	}

	size_t half = node->left + (node->right - node->left) / 2;
	node->left_tree = new Node(node->left, half);
	node->right_tree = new Node(half + 1, node->right);
	int left_min = buildTree(node->left_tree);
	int right_min = buildTree(node->right_tree);
	return node->minimum = min(left_min, right_min);
}

void SegmentTree::Node::push () {
	if (!isUpd)
		return;
	
	if (left_tree) {
		left_tree->isUpd = true;
		left_tree->upd = upd;
	}
	
	if (right_tree) {
		right_tree->isUpd = true;
		right_tree->upd = upd;
	}

	minimum = upd;
	isUpd = false;
}


/* Subsegment methods: */

int SegmentTree::minOnSubsegment (size_t l, size_t r, Node *node) {
	if (!node)
		return neutral;

	node->push();

	if (curSegmInQuerySegm(l, r, node->left, node->right))
		return node->minimum;

	if (!curSegmOutQuerySegm(l, r, node->left, node->right))
		return min(minOnSubsegment(l, r, node->left_tree), minOnSubsegment(l, r, node->right_tree));

	return neutral;
}

void SegmentTree::updateOnSubsegment (size_t l, size_t r, int upd, Node *node) {
	if (!node)
		return;

	node->push();

	if (curSegmInQuerySegm(l, r, node->left, node->right)) {
		node->isUpd = true;
		node->upd = upd;
		node->push();
		return;
	}

	if (!curSegmOutQuerySegm(l, r, node->left, node->right)) {
		updateOnSubsegment(l, r, upd, node->left_tree);
		updateOnSubsegment(l, r, upd, node->right_tree);
		node->minimum = std::min<int>(node->left_tree->minimum, node->right_tree->minimum);
	}
}


/* User subsegment methods: */

int SegmentTree::RMQ (size_t l, size_t r) {
	return minOnSubsegment(l, r, root);
}

void SegmentTree::RUQ (size_t l, size_t r, int upd) {
	updateOnSubsegment(l, r, upd, root);
}


/* Solving problem: */

int main() {
	int n, q;
	cin >> n >> q;
	vector<int> arr(n, 2147483647);

	SegmentTree segmentTree(arr);
	//segmentTree.print();

	for (int i = 0; i < q; i ++) {
		int type;
		cin >> type;

		if (type == 0) {
			size_t l, r;
			int upd;
			cin >> l >> r >> upd;
			segmentTree.RUQ(l, r, upd);
		}

		else {
			size_t l, r;
			cin >> l >> r;
			cout << segmentTree.RMQ(l, r) << endl;
		}
	}

	return 0;
}



Measured memory_bytes: 16064