#include <algorithm>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <iostream>
#include <vector>
using namespace std;
template <typename T, typename E> class LazySegmentTree {
  using F = function<T(T, T)>;
  using G = function<T(T, E)>;
  using H = function<E(E, E)>;

private:
  F operation; // 区間に対する処理
  G affecter;  // 作用させる関数
  H merger;    // 作用素をマージ
  T et;        // 単位元
  E ee;
  vector<T> data;
  vector<E> lazy;
  size_t len, height; // 管理している要素数、高さ

  void init(int n_) {
    len = 1;
    height = 0;
    while (len < n_)
      len *= 2, height++;
    data.resize(2 * len, et);
    lazy.resize(2 * len, ee);
  }
  void eval(int k) {
    if (lazy[k] == ee)
      return;
    lazy[2 * k] = merger(lazy[2 * k], lazy[k]);
    lazy[2 * k + 1] = merger(lazy[2 * k + 1], lazy[k]);
    data[k] = affecter(data[k], lazy[k]);
    lazy[k] = ee;
  }
  inline void eval_from_root(int k) {
    // 根からkまで伝播
    for (int i = height; i > 0; i--)
      eval(k >> i);
  }
  inline T reflect(int k) {
    return lazy[k] == et ? data[k] : affecter(data[k], lazy[k]);
  }
  inline void recalc(int k) {
    while (k /= 2)
      data[k] = operation(reflect(2 * k), reflect(2 * k + 1));
  }

public:
  LazySegmentTree(size_t N, T et, E ee, F operation, G affecter, H merger)
      : et(et), ee(ee), operation(operation), affecter(affecter),
        merger(merger) {
    init(N);
  }

  template <typename Ite>
  LazySegmentTree(size_t N, T et, E ee, F operation, G affecter, H merger,
                  Ite start, Ite end)
      : et(et), ee(ee), operation(operation), affecter(affecter),
        merger(merger) {
    init(N);
    build(start, end);
  }
  template <typename Ite> void build(Ite start, Ite end) {
    for (auto i = start; i < end; i++)
      data[i - start + len] = *i;
    for (int i = len - 1; i > 0; i--)
      data[i] = operation(data[2 * i], data[2 * i + 1]);
  }
  void update(size_t a, size_t b, E x) {
    // [a,b)
    if (a >= b)
      return;
    eval_from_root(a += len);
    eval_from_root(b += len - 1);
    for (int l = a, r = b + 1; l < r; l /= 2, r /= 2) {
      if (l % 2) {
        lazy[l] = merger(lazy[l], x);
        l++;
      }
      if (r % 2) {
        r--;
        lazy[r] = merger(lazy[r], x);
      }
    }
    recalc(a);
    recalc(b);
  }
  T query(size_t a, size_t b) {
    // [a,b)の処理
    if (a >= b)
      return et;
    eval_from_root(a += len);
    eval_from_root(b += len - 1);
    T vl = et, vr = et;
    for (int l = a, r = b + 1; l < r; l /= 2, r /= 2) {
      if (l % 2)
        vl = operation(vl, reflect(l++));
      if (r % 2)
        vr = operation(reflect(--r), vr);
    }
    return operation(vl, vr);
  }
  void set_val(size_t a, T x) {
    eval_from_root(a += len);
    data[a] = x;
    lazy[a] = ee;
    recalc(a);
  }
};

// varify AOJ DSL_2_F
using ll = long long;
int main() {
  int n, q;
  cin >> n >> q;
  auto lst = LazySegmentTree<ll, ll>(
      n, (1ll << 31) - 1, (1ll << 31) - 1, [](ll a, ll b) { return min(a, b); },
      [](ll a, ll b) { return b; }, [](ll a, ll b) { return b; });
  for (int i = 0; i < q; i++) {
    int k;
    cin >> k;
    if (k == 0) {
      int s, t, x;
      cin >> s >> t >> x;
      lst.update(s, t + 1, x);
    } else {
      int s, t;
      cin >> s >> t;
      cout << lst.query(s, t + 1) << '\n';
    }
  }
}



Measured memory_bytes: 7072