#include <iostream>
#include <climits>
#include <algorithm>

#define lson l, m, o << 1
#define rson m + 1, r, o << 1 | 1

const int N = 1e5 + 1;

int mn[N << 2];
int lazy[N << 2];

void up(int o) {
  mn[o] = std::min(mn[o << 1], mn[o << 1 | 1]);
}

void down(int o) {
  if (lazy[o] != -1) {
    mn[o << 1] = lazy[o];
    mn[o << 1 | 1] = lazy[o];
    lazy[o << 1] = lazy[o];
    lazy[o << 1 | 1] = lazy[o];
    lazy[o] = -1;
  }
}

void build(int l, int r, int o) {
  lazy[o] = -1;
  if (l == r) {
    mn[o] = INT_MAX;
    return;
  }
  int m = (l + r) >> 1;
  build(lson);
  build(rson);
  up(o);
}

void modify(int v, int L, int R, int l, int r, int o) {
  if (L <= l && R >= r) {
    lazy[o] = v;
    mn[o] = v;
    return;
  }
  down(o);
  int m = (l + r) >> 1;
  if (L <= m) modify(v, L, R, lson);
  if (R > m) modify(v, L, R, rson);
  up(o);
}

int query(int L, int R, int l, int r, int o) {
  if (L <= l && R >= r) {
    return mn[o];
  }
  down(o);
  int m = (l + r) >> 1;
  int res = INT_MAX;
  if (L <= m) res = std::min(res, query(L, R, lson));
  if (R > m) res = std::min(res, query(L, R, rson));
  return res;
}

int main() {
  int n, q;
  while (std::cin >> n >> q) {
    build(1, n, 1);
    while (q --) {
      int op;
      std::cin >> op;
      if (op == 0) {
        int l, r, v;
        std::cin >> l >> r >> v;
        l ++;
        r ++;
        modify(v, l, r, 1, n, 1);
      } else {
        int l, r;
        std::cin >> l >> r;
        l ++;
        r ++;
        std::cout << query(l, r, 1, n, 1) << std::endl;
      }
    }
  }
  return 0;
}

