#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD = 1000000007;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

#ifdef _DEBUG
#include "debug.h"
#else
#define debug(...)
#define print(...)
#endif

template< typename T, typename E >
struct LazySegTree {
    using F = function< T(T, T) >;
    using G = function< T(T, E) >;
    using H = function< E(E, E) >;
    int size;
    vector<T> data;
    vector<E> lazy;

    const F f;
    const G g;
    const H h;
    const T t0;
    const E e0;

    LazySegTree(int n, const F f, const G g, const H h, const T &t0, const E &e0) : f(f), g(g), h(h), t0(t0), e0(e0) {
        size = 1;
        while(size < n) size *= 2;
        data.assign(2*size-1, t0);
        lazy.assign(2*size-1, e0);
    }

    LazySegTree(vector<T> &vec, const F f, const G g, const H h, const T &t0, const E &e0) : f(f), g(g), h(h), t0(t0), e0(e0) {
        size = 1;
        while(size < sz(vec)) size *= 2;
        data.assign(2*size-1, t0);
        lazy.assign(2*size-1, e0);
        rep(i, min(sz(vec), size)) data[i+size-1] = vec[i];
        for(int i=size-2; i>=0; i--) data[i] = f(data[2*i+1], data[2*i+2]);

    }

    void eval(int k) {
        if (lazy[k] == e0) return;
        if (k<size-1) {
            lazy[k*2+1] = h(lazy[k*2+1], lazy[k]);
            lazy[k*2+2] = h(lazy[k*2+2], lazy[k]);
        }
        data[k] = g(data[k], lazy[k]);
        lazy[k] = e0;
    }

    void update(int a, int b, const T &val, int k=0, int l=0, int r=-1) {
        eval(k);
        if (r<0) r = size;
        if (a<=l && b>=r) {
            lazy[k] = h(lazy[k], val);
            eval(k);
        } else if (a<r && b>l) {
            update(a, b, val, k*2+1, l, (l+r)/2);
            update(a, b, val, k*2+2, (l+r)/2, r);
            data[k] = f(data[k*2+1], data[k*2+2]);
        }
    }

    T query(int a, int b, int k=0, int l=0, int r=-1) {
        eval(k);
        if (r<0) r = size;
        if (r<=a || l>=b) {
            return t0;
        } else if (a<=l && b>=r) {
            return data[k];
        } else {
            T vl = query(a, b, k*2+1, l, (l+r)/2);
            T vr = query(a, b, k*2+2, (l+r)/2, r);
            return f(vl, vr);
        }
    }
};

int main() {
    int n, q; cin >> n >> q;
    auto f = [](int x1, int x2){return min(x1, x2);};
    auto g = [](int x1, int x2){return x2;};
    auto h = [](int x1, int x2){return x2;};
    const int MAXI = (int)(pow(2, 31)-1);
    LazySegTree<int, int> seg(n, f, g, h, MAXI, MAXI);
    rep(i, q) {
        int com; cin >> com;
        if (com==0) {
            int s, t, x; cin >> s >> t >> x;
            seg.update(s, t+1, x);
        } else {
            int s, t; cin >> s >> t;
            cout << seg.query(s, t+1) << endl;
        }
        // debug(seg.data); debug(seg.lazy);
    }
}


Measured memory_bytes: 4868