#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <cstring>

/* 
PascalCase  クラス名
camelCase   メソッド名，関数名，変数名
snake_case  ファイル名，名前空間，std のメソッド名，変数名，型名に準じる場合
SNAKE_CASE	マクロ名，static const 定数，列挙体
*/

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, init, n) for(int i = init; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define Cout(obj) cout << obj << endl
#define Size(obj) (int)(obj).size()
#define fcout cout << fixed << setprecision(10)
#define fi first
#define se second

using namespace std;
using ll = long long int;

const int MOD = 1e9 + 7;
const int iINF = pow(2, 31) - 1;
const long long int llINF = 1e18;
const double PI = acos(-1.0);

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

template <typename T>
struct LazzySegTreeMin
{
  private:
    ll N = 1;
    vector<T> node, lazy;
    vector<bool> lazyFlag;

  public:
    LazzySegTreeMin(vector<T> vec)
    {
        int size = vec.size();

        while (N < size)
        {
            N *= 2;
        }

        node.resize(2 * N - 1);
        lazy.resize(2 * N - 1, iINF);
        lazyFlag.resize(2 * N - 1, false);

        REP(i, size)
        {
            node[i + N - 1] = vec[i];
        }

        for (int i = N - 2; 0 <= i; i--)
        {
            node[i] = min(node[2 * i + 1], node[2 * i + 2]);
        }
    }

    void eval(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, T value, int k = 0, int l = 0, int r = -1)
    {
        if(r < 0) r = N;

        eval(k, l, r);

        if(b <= l || r <= a) return;

        if(a <= l && r <= b)
        {
            lazy[k] = value;
            lazyFlag[k] = true;
            eval(k, l, r);
        }
        else
        {
            update(a, b, value, 2 * k + 1, l, (l + r) / 2);
            update(a, b, value, 2 * k + 2, (l + r) / 2, r);
            node[k] = min(node[2 * k + 1], node[2 * k + 2]);
        }
    }

    T getMin(int a, int b, int i = 0, int l = 0, int r = -1)
    {
        if (r < 0)
        {
            r = N;
        }

        eval(i, l, r);

        if (r <= a || b <= l)
        {
            return iINF;
        }

        if (a <= l && r <= b)
        {
            return node[i];
        }

        T vl = getMin(a, b, 2 * i + 1, l, (l + r) / 2);

        T vr = getMin(a, b, 2 * i + 2, (l + r) / 2, r);

        return min(vl, vr);
    }
};


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, Q;
    cin >> N >> Q;

    vector<int> vec(N, iINF);
    LazzySegTreeMin<int> seg(vec);

    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.getMin(s, t + 1));
        }
    }    

    
    return 0;
}


Measured memory_bytes: 5792