#include <bits/stdc++.h>
#define ll long long
#define REP(i, n) for (ll i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (ll i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define fi first
#define se second
#define pb push_back
#define debug(x) cerr << #x << ": " << (x) << endl
#define debug2(x, y) cerr << #x << ": " << (x) << " " << #y << ": " << y << endl;
#define int long long
using namespace std;
using II = pair<int, int>;
using VII = vector<II>;
using VI = vector<int>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
template <class T = int> inline T in() { T x; cin >> x; return x; }
template <class T = int> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <class T = int> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template <class T> ostream& operator<<(ostream &s, const vector<T>& d) { int n = d.size(); REP (i, n) s << d[i] << " "; return s; }
template <class T> ostream& operator<<(ostream &s, const vector<vector<T>>& dd) { for (vector<T> d: dd) s << d << endl; return s; }
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
const int MOD = 1e9 + 7;

const int DUM = -100;
class SegmentTree {
  // k番目のノードにのlazyを伝搬
  void eval(int k) {
    if (lazy[k] == DUM) return;
    node[k] = lazy[k];
    if (k < N - 1) {
      // 最下段でなければ下のlazyに伝搬
      lazy[2 * k + 1] = lazy[k];
      lazy[2 * k + 2] = lazy[k];
    }
    lazy[k] = DUM;
  }
  // k番目のノード[l, r)について、[a, b)をxに変更
  void update(int a, int b, int x, int k, int l, int r) {
    eval(k);
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      lazy[k] = x;
      eval(k);
    } else {
      update(a, b, x, 2 * k + 1, l, (l + r) / 2);
      update(a, b, x, 2 * k + 2, (l + r) / 2, r);
      node[k] = min(node[2 * k + 1], node[2 * k + 2]);
    }
  }
  // k番目のノード[l, r)について、[a, b)のクエリを求める
  int query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return 1e18;
    eval(k);
    if (a <= l && r <= b) return node[k];
    int vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
    int vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
public:
  int N;
  VI node, lazy;
  SegmentTree(const VI& a) {
    int sz = a.size();
    for (N = 1; N < sz; N *= 2);
    node.resize(2 * N - 1, 1e18);
    lazy.resize(2 * N - 1, DUM);
    REP (i, sz) node[N - 1 + i] = a[i];
    for (int i = N - 2; i >= 0; i--) node[i] = min(node[2 * i + 1], node[2 * i + 2]);
  }
  SegmentTree(int n) {
    for (N = 1; N < n; N *= 2);
    node.resize(2 * N - 1, 1e18);
    lazy.resize(2 * N - 1, DUM);
  }
  // [a, b)にxを加算
  void update(int a, int b, int x) {
    update(a, b, x, 0, 0, N);
  }
  // [a, b)
  int query(int a, int b) {
    return query(a, b, 0, 0, N);
  }
};
signed main() {
  int n, q; cin >> n >> q;
  SegmentTree seg(VI(n, (1LL << 31) - 1));
  while (q--) {
    int z; cin >> z;
    if (z == 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;
    }
  }
}



Measured memory_bytes: 7856