#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;

template <class T>
inline bool chmin(T &a, T b){
    if (a > b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b){
    if (a < b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

const int INF = pow(2,31)-1;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

struct LazySegmentTree{
private:
    int n;
    vector<int> node,lazy;
    vector<bool> lazyFlag;

public:
    LazySegmentTree(vector<int> v){
        int sz = (int)v.size();
        n = 1;
        while(n<sz) n*=2;
        node.resize(2*n-1);
        lazy.resize(2*n-1,INF);
        lazyFlag.resize(2*n-1,false);
        for(int i = 0; i<sz; i++) node[i+n-1] = v[i];
        for(int i = n-2; i>=0; i--) node[i] = min(node[2*i+1],node[2*i+2]);
    }

    void LazyEvaluate(int k, int l, int r){
        if(lazyFlag[k]){
            node[k] = lazy[k];
            if(r-l>1){
                lazy[k*2+1] = lazy[k*2+2] = lazy[k];
                lazyFlag[k*2+1] = lazyFlag[k*2+2] = true;
            }
            lazyFlag[k] = false;
        }
    }

    void update(int a, int b, int x, int k = 0, int l=0, int r =-1){
        if(r < 0) r = n;
        LazyEvaluate(k,l,r);
        if(b<=l || r<=a) return;
        if(a<=l && r<=b){
            lazy[k] = x;
            lazyFlag[k] = true;
            LazyEvaluate(k,l,r);
        }
        else{
            update(a,b,x,2*k+1,l,(l+r)/2);
            update(a,b,x,2*k+2,(l+r)/2,r);
            node[k] = min(node[2*k+1],node[2*k+2]);
        }
    }

    int find(int a,int b,int k=0,int l=0,int r = -1){
        if(r<0) r=n;
        LazyEvaluate(k,l,r);
        if(b<=l || r<=a) return INF;
        if(a<=l && r<=b) return node[k];
        int vl = find(a,b,2*k+1,l,(r+l)/2);
        int vr = find(a,b,2*k+2,(l+r)/2,r);
        return min(vl,vr);
    }
};

int main(){
    int n,q;
    cin >> n >> q;
    LazySegmentTree seg(vector<int>(n,INF));
    rep(i,q){
        int query;
        cin >> query;
        if(query==0){
            int s,t,x;
            cin >> s >> t >> x;
            seg.update(s,t+1,x);
        }
        else{
            int s,t;
            cin >> s >> t;
            cout << seg.find(s,t+1) << endl;
        }
    }
}


Measured memory_bytes: 5272