/*
	DSL: domain-specific language
	http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_F
	12/5/2017
	TLE: 15/22, doing the query(use loop for (i,j))
	solution: add another ele in node to keep element, look liks add more element is hard to update the 
	Final solution1.0: use the recusive and 
*/

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
//#define N 131072 //100000 why
#define MAXVAL ((long int) ((unsigned long) (1 << 31) - 1))  //*2

int min(int a, int b){return a>b?b:a;}
int query(int search_left,int search_right,int node_id,int node_left,int node_right);
void update(int update_left,int update_right,int new_value,int node_id,int node_left,int node_right);
int data[2*131072+100];      //the size of array, for present the tree
//BEGIN FROM 0;
int main(){
	int n = 0, q = 0;
	int N = 1;
	int a,b,c;
	//read from the file
	FILE *fp;
	//fp = fopen("in.txt","r");
	scanf("%d %d",&n,&q);
	
	//how to calculate the beginning index (the last layer of the tree)
	//how many nodes in last layer
	while(N<n) N = N<<1;
	//printf("N%d\n",N);
	for(int i = 0; i<=2*N-2; i++){
		data[i] = MAXVAL;
	}
	
	//printf("count:%d",count);
	
	for(int i = 1; i <=q; i++){
		int temp = 0;
		scanf("%d",&temp);
		if(temp==0){
			scanf("%d %d %d",&a,&b,&c);
			update(a,b,c,0,0,N-1);
		}
		else if(temp==1){
			scanf("%d %d",&a,&b);
			printf("%d\n",query(a,b,0,0,N-1));
		}
	}
	return 0;
}
/*
	update the value in the array, no return 
	foramtion: if() return; 
				f();
*/
void update(int update_left,int update_right,int new_value,int node_id,int node_left,int node_right){
    if(update_right < node_left || update_left > node_right)return;
    else if(update_left <= node_left && update_right >= node_right){
        data[node_id] = new_value;//to update the value(if in the right rage or a single point;
    }else{
        if(data[node_id] >= 0){ //deal with previous node (to check the if there is previous vlue to update)
            data[node_id*2+1]= data[node_id];
            data[node_id*2+2]= data[node_id];
            //update(node_left,node_right,data[node_id],2*node_id+1,node_left,(node_left+node_right)/2);
            //update(node_left,node_right,data[node_id],2*node_id+2,(node_left+node_right)/2+1,node_right);
            data[node_id] = -1;//why set -1 (unfold it)
        }
        //update with update_left and update_right
        update(update_left,update_right,new_value,2*node_id+1,node_left,(node_left+node_right)/2);
        update(update_left,update_right,new_value,2*node_id+2,(node_left+node_right)/2+1,node_right);
    }
}
int query(int search_left,int search_right,int node_id,int node_left,int node_right){
    if(search_right < node_left || search_left > node_right){
        return MAXVAL;//not in the range, e.g. 1 1 2
    }else{
        if(data[node_id] != -1)return data[node_id]; //not unfold, how to know if we have the right node
        //if(search_left>=node_left&&search_right<=node_right) return data[node_id];
		else{
            int left = query(search_left,search_right,2*node_id+1,node_left,(node_left+node_right)/2);
            int right = query(search_left,search_right,2*node_id+2,(node_left+node_right)/2+1,node_right);
            return min(left,right);
        }
    }
}

Measured memory_bytes: 3780