#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template<typename T = ll, typename E = ll>
struct LEST_Operator_RM_RU {
    static constexpr T I_T = std::numeric_limits<T>::max();
    static constexpr E I_E = E(-1);
    template<typename T_L = T, typename T_R = T> constexpr T f(T_L && lhs, T_R && rhs) const {
        static_assert(std::is_same<std::remove_reference_t<T_L>, T>::value, "");
        static_assert(std::is_same<std::remove_reference_t<T_R>, T>::value, "");
        return min<T>(lhs, rhs);
    }
    constexpr T g(T& lhs, E& rhs) const { return (T)rhs; }
    constexpr E h(E& lhs, E& rhs) const { return rhs; }
};
template<typename T, typename E> constexpr T LEST_Operator_RM_RU<T, E>::I_T;
template<typename T, typename E> constexpr E LEST_Operator_RM_RU<T, E>::I_E;

template<typename T, typename E, class F>
struct LazyEvaluationSegmentTree {
    const F op = F();
    int n, height;
    vector<T> dat;
    vector<E> laz;
    void init(int n_) {
        n = 1;
        height = 0;
        while (n < n_) n *= 2, height++;
        dat.assign(2 * n, op.I_T);
        laz.assign(2 * n, op.I_E);
    }
    void build(const vector<T>& v) {
        int n_ = v.size();  init(n_);
        for (int i = 0; i < n_; ++i) dat[n + i] = v[i];
        for (int i = n - 1; i; --i) dat[i] = op.f(dat[i << 1], dat[(i << 1) + 1]);
    }
    T reflect(int k) {
        return laz[k] == op.I_E ? dat[k] : op.g(dat[k], laz[k]);
    }
    void eval(int k) {
        if (laz[k] == op.I_E) return;
        laz[(k << 1)] = op.h(laz[k << 1], laz[k]);
        laz[(k << 1) + 1] = op.h(laz[(k << 1) + 1], laz[k]);
        dat[k] = reflect(k);
        laz[k] = op.I_E;
    }
    void thrust(int k) {
        for (int i = height; i; i--) eval(k >> i);
    }
    void thrust(int l, int r) {
        if (l == r) { thrust(l); return; }
        int x = l ^ r, i = height;
        for (; !(x >> i); i--) { eval(l >> i); }
        for (; i; i--) { eval(l >> i); eval(r >> i); }
    }
    void recalc(int k) {
        while (k >>= 1) dat[k] = op.f(reflect(k << 1), reflect((k << 1) + 1));
    }
    void recalc(int l, int r) {
        int x = l ^ r;
        while (x > 1) {
            x >>= 1; l >>= 1; r >>= 1;
            dat[l] = op.f(reflect(l << 1), reflect((l << 1) + 1));
            dat[r] = op.f(reflect(r << 1), reflect((r << 1) + 1));
        }
        while (l > 1) {
            l >>= 1;
            dat[l] = op.f(reflect(l << 1), reflect((l << 1) + 1));
        }
    }
    void update(int a, int b, E v) {
        //thrust(a += n);
        //thrust(b += n - 1);
        thrust(a += n, b += n - 1);
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) laz[l] = op.h(laz[l], v), l++;
            if (r & 1) --r, laz[r] = op.h(laz[r], v);
        }
        //recalc(a);
        //recalc(b);
        recalc(a, b);
    }
    void set_val(int a, T v) {
        thrust(a += n);
        dat[a] = v;
        laz[a] = op.I_E;
        recalc(a);
    }
    T query(int a, int b) {
        //thrust(a += n);
        //thrust(b += n - 1);
        thrust(a += n, b += n - 1);
        T vl = op.I_T, vr = op.I_T;
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) vl = op.f(vl, reflect(l++));
            if (r & 1) vr = op.f(reflect(--r), vr);
        }
        return op.f(vl, vr);
    }
};

int main() {
    int n, q;
    cin >> n >> q;

    vector<int> a(n, INT32_MAX);
    LazyEvaluationSegmentTree<int, int, LEST_Operator_RM_RU<int, int>> lest;
    lest.build(a);

    vector<int> ans;
    for (int i = 0; i < q; ++i) {
        int type;
        cin >> type;

        if (type) {
            int s, t;
            cin >> s >> t;

            ans.push_back(lest.query(s, t + 1));
        }
        else {
            int s, t, x;
            cin >> s >> t >> x;

            lest.update(s, t + 1, x);
        }
    }

    for (int a : ans) {
        cout << a << endl;
    }
}


Measured memory_bytes: 5880