#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
#include <functional>
#include <random>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef unordered_map<ll, ll> uii;
typedef unordered_map<ll, ll> uuii;
typedef unordered_map<ll, ll> uuuii;
typedef long double LD;
typedef vector<LD> vld;
typedef vector<pair<LD, LD>> vpld;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
typedef vector<vvpl> vvvpl;
typedef pair<ll, PL> TL;
typedef vector<TL> vtl;
typedef vector<vtl> vvtl;
typedef long double ld;
typedef vector<ld> vld;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back
#define ALL(X) (X).begin(),(X).end()

template <typename T> T gcd(T a, T b) {return (a == 0) ? b : gcd(b%a, a);}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b;}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec /* copy */){
    sort(ALL(vec)); vec.erase(unique(vec.begin(), vec.end()), vec.end()); return vec;
}

inline ll popcnt(ll x){return __builtin_popcountll((unsigned long long)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
//friend bool operator<(const tpl& lhs, const tpl& rhs){
//    return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r);
//}

bool bit(ll st, ll b){return ((st>>b)&1) == 1;}

template <typename X, typename M>
class LazySegmentTree{
private:
    using FX = std::function<X(X, X)>; // query for data
    using FA = std::function<X(X, M)>; // update data by lazy value
    using FM = std::function<M(M, M)>; // update lazy
    using FP = std::function<M(M, size_t)>; // calculate a lazy value for a segment
    ll sz;
    vector<X> data;
    vector<M> lazy;
    FX fx;
    FA fa;
    std::function<M(M, M)> fm;
    std::function<M(M, size_t)> fp;
    const X ex; // unit for X
    const M em; // unit for M

public:
    LazySegmentTree(const vector<X>& v, FX fx, FA fa, FM fm, FP fp, X ex, M em)
    : fx(fx), fa(fa), fm(fm), fp(fp), ex(ex), em(em){
        
        this->sz = 1;
        while(this->sz < v.size()) this->sz = (this->sz<<1);
        
        this->data = std::vector<X>(2*this->sz - 1, ex);
        this->lazy = std::vector<M>(2*this->sz - 1, em);
        
        rep(i, v.size()) this->data[i+ sz-1] = v.at(i);
        for(ll k = sz-2; k >= 0; k--){
            this->data[k] = fx(data[2*k+1], data[2*k+2]);
        }
    }
    
    void eval(ll k, size_t len){
        if(lazy[k] == em) return;
        if(k < sz-1){
            lazy[2*k+1] = fm(lazy[2*k+1], lazy[k]);
            lazy[2*k+2] = fm(lazy[2*k+2], lazy[k]);
        }
        data[k] = fa(data[k], fp(lazy[k], len));
        lazy[k] = em;
    }
    
    
    void update(ll ql, ll qr, M val, ll k = 0, ll sl = 0, ll sr = -1){
        if(sr < 0) sr = sz;
        
        eval(k, sr-sl);
        if(qr <= sl || sr <= ql) return;
        else if(ql <= sl && sr <= qr){
            lazy[k] = fm(lazy[k], val);
            eval(k, sr-sl);
        }
        else{
            update(ql, qr, val, 2*k+1, sl, (sl+sr)/2);
            update(ql, qr, val, 2*k+2, (sl+sr)/2, sr);
            data[k] = fx(data[2*k+1], data[2*k+2]);
        }
    }
    
    X query(ll ql, ll qr, ll k = 0, ll sl = 0, ll sr = -1){
        if(sr < 0) sr = sz;
        eval(k, sr-sl);
        
        if(qr <= sl || sr <= ql) return ex;
        
        if(ql <= sl && sr <= qr) return data[k];
        else{
            X lval = query(ql, qr, 2*k+1, sl, (sl+sr)/2);
            X rval = query(ql, qr, 2*k+2, (sl+sr)/2, sr);
            return fx(lval, rval);
        }
    }
    
    X operator[](ll idx) const{
        return this->data.at(idx + sz-1);
    }
};


int main(){
#ifdef __DEBUG_LOCAL__
    ifstream file("../../../../../in.txt"); if(file.is_open()) cin.rdbuf(file.rdbuf());
#endif
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    
    ll N, Q; cin >> N >> Q;
    const ll init = (1ll<<31)-1;
    auto lseg = LazySegmentTree<ll, ll>(vl(N, init),
                                        [](ll x, ll y){return min(x, y);},
                                        [](ll x, ll m){return m;},
                                        [](ll m, ll n){return n;},
                                        [](ll m, size_t len){return m;},
                                        init,
                                        init);
    
    rep(_, Q){
        ll type; cin >> type;
        if(type == 0){
            ll s, t, x; cin >> s >> t >> x; t++;
            lseg.update(s, t, x);
        }
        else if(type == 1){
            ll s, t; cin >> s >> t; t++;
            cout << lseg.query(s, t) << endstr;
        }
    }
    
    return 0;
}



Measured memory_bytes: 7880