#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)

//ここから編集
template<typename T>
struct LazySegmentTree{
  const T INF = numeric_limits<T>::max();
  int n0;
  vector<T> node, lazy;

  LazySegmentTree(vector<T> &v){
    int n = v.size();
    n0 = 1;
    while(n0 < n) n0 <<= 1;
    node.resize(2*n0-1);
    lazy.assign(2*n0-1, INF);
    for(int i=0; i<n; i++) node[i+n0-1] = v[i];
    for(int i=n0-2; i>=0; i--) node[i] = min(node[i*2+1], node[i*2+2]);
  }

  void eval(int k){
    if(lazy[k] == INF) return;
    if(k < n0-1){
      lazy[k*2+1] = lazy[k];
      lazy[k*2+2] = lazy[k];
    }

    node[k] = lazy[k];
    lazy[k] = INF;
  }

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

  void update(int l, int r, T x) { update(l, r, x, 0, 0, n0); }

  T query(int a, int b, int k, int l, int r){
    eval(k);
    if(r <= a || b <= l) return INF;
    else if(a <= l && r <= b){
      return node[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 min(vl, vr);
    }
  }
  T query(int l, int r) { return query(l, r, 0, 0, n0); }

  inline T operator[](int a) { return query(a, a + 1); }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(5);
  
  int N, Q; cin >> N >> Q;
  vector<int> a(N, numeric_limits<int>::max());
  LazySegmentTree<int> seg(a);

  REP(i,Q){
    int q; cin >> q;
    if(q == 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;
    }
    // for(int j=0; j<N; j++){
    //   cout << seg[j] << " ";
    // }
    // cout << endl;
  }

  return 0;
}


Measured memory_bytes: 5220