#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const int MOD=1e9+7;
const int INF=(1LL<<31)-1;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, 0, -1, 0};
int dy[]={0, -1, 0, 1};

class SquareDivision{
    private:
        const int bucketSize = 256;
        ll N, B;
        vector<int> data;
        vector<int> bucketMin;
        vector<bool> lazyFlag;
        vector<int> lazyUpdate;

    public:
        void prepare(int n){
            B = (n + bucketSize - 1)/ bucketSize;
            N = B * bucketSize;
            data.assign(N, INF);
            bucketMin.assign(B, INF);
            lazyFlag.assign(B, false);
            lazyUpdate.assign(B, 0);
        }

        void eval(int k){
            if(lazyFlag[k]){
                lazyFlag[k] = false;
                for(int i=k*bucketSize; i<(k+1)*bucketSize; i++){
                    data[i] = lazyUpdate[k];
                }
            }
        }

        void update(int s, int t, int x){
            for(int k=0; k<B; k++){
                int l = k * bucketSize;
                int r = (k + 1) * bucketSize;

                if(r <= s || t <= l) continue;

                if(s <= l && r <= t){
                    bucketMin[k] = x;
                    lazyFlag[k] = true;
                    lazyUpdate[k] = x;
                }
                else{
                    eval(k);
                    for(int i=max(s, l); i<min(t, r); i++){
                        data[i] = x;
                    }

                    int minVal = INF;
                    for(int i=l; i<r; i++){
                        minVal = min(minVal, data[i]);
                    }
                    bucketMin[k] = minVal;
                }
            }
        }

        int find(int s, int t){
            int minVal = INF;
            for(int k=0; k<B; k++){
                int l = k * bucketSize;
                int r = (k + 1) * bucketSize;

                if(r <= s || t <= l) continue;

                if(s <= l && r <= t){
                    minVal = min(minVal, bucketMin[k]);
                }
                else{
                    eval(k);
                    for(int i=max(s, l); i<min(t, r); i++){
                        minVal = min(minVal, data[i]);
                    }
                }
            }

            return minVal;
        }
};

int main(){
    int n, q; cin>>n>>q;
    SquareDivision ans;
    ans.prepare(n);

    while(q--){
        int c; cin>>c;
        if(c == 0){
            int s, t, x; cin>>s>>t>>x;
            ans.update(s, t+1, x);
        }
        else{
            int s, t; cin>>s>>t;
            cout << ans.find(s, t+1) << endl;
        }
    }
}


Measured memory_bytes: 3340