#line 1 "test/aoj/DSL_2_F.test.cpp"
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_F"

#line 2 "test/aoj/../../monoid/min.hpp"
#include <algorithm>
#include <limits>

namespace monoid {
template <class T>
struct min {
  typedef T value_t;
  T identity() const { return std::numeric_limits<T>::max();}
  T merge(T a, T b) const { return std::min(a, b); }
};
} // namespace monoid#line 2 "test/aoj/../../monoid/fill.hpp"
#include <utility>

namespace monoid {
template <class T>
struct fill {
  typedef std::pair<bool, T> value_t;
  value_t identity() const { return std::make_pair(false, T()); }
  value_t merge(value_t a, value_t b) const { return b.first ? b : a; }
};
} // namespace monoid#line 1 "test/aoj/../../datastructure/lazy-segment-tree.cpp"
#include <cassert>
#include <functional>
#include <utility>
#include <vector>
#include <iostream>

using namespace std;

// FIXME: coding styleを統一する
// FIXME: 要素に作用素を適用する関数であるGをclass化する
// FIXME: 0-indexedに変えたい
template <class Monoid, class OperatorMonoid>
struct LazySegmentTree {
  typedef typename Monoid::value_t value_t;
  typedef typename OperatorMonoid::value_t operator_t;
  const Monoid monoid;
  const OperatorMonoid op_monoid;
  using G = function< value_t(value_t, operator_t) >;
  const G g;
  int n; // n_以上の最小の2冪
  int height; // 木の深さ. n == pow(2, height)
  vector<value_t> data;
  vector<operator_t> lazy;
  LazySegmentTree(const G g): monoid(), op_monoid(), g(g) {}

  void init(int n_) {
    n = 1;
    height = 0;
    while (n < n_) { n *= 2; ++height; }
    data.assign(2*n, monoid.identity());
    lazy.assign(2*n, op_monoid.identity());
  }

  void set(int k, value_t x) {
    data[k + n] = x;
  }

  void build(const vector<value_t> &v) {
    int n_=v.size();
    init(n_);
    for(int i=0;i<n_;i++) data[n+i]=v[i];
    for(int i=n-1;i;i--)
      data[i] = monoid.merge(data[(i<<1)|0], data[(i<<1)|1]);
  }

  inline void propagate(int k) {
    if(lazy[k] != op_monoid.identity()) {
      // cerr << k << " " << lazy[k].first << " " << lazy[k].second << endl;
      lazy[2 * k + 0] = op_monoid.merge(lazy[2 * k + 0], lazy[k]);
      lazy[2 * k + 1] = op_monoid.merge(lazy[2 * k + 1], lazy[k]);
      data[k] = reflect(k);
      lazy[k] = op_monoid.identity();
    }
  }

  inline value_t reflect(int k) {
    return lazy[k] == op_monoid.identity() ? data[k] : g(data[k], lazy[k]);
  }

  inline void recalc(int k) {
    while(k >>= 1) data[k] = monoid.merge(reflect(2 * k + 0), reflect(2 * k + 1));
  }

  inline void thrust(int k) {
    for(int i = height; i > 0; i--) propagate(k >> i);
  }

  void update(int a, int b, operator_t x) { // 0-indexed, [a, b)
    thrust(a += n);
    thrust(b += n - 1);
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) lazy[l] = op_monoid.merge(lazy[l], x), ++l;
      if(r & 1) --r, lazy[r] = op_monoid.merge(lazy[r], x);
    }
    recalc(a);
    recalc(b);
  }

  value_t query(int a, int b) { // 0-indexed, [a, b)
    thrust(a += n);
    thrust(b += n - 1);
    value_t L = monoid.identity(), R = monoid.identity();
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) L = monoid.merge(L, reflect(l++));
      if(r & 1) R = monoid.merge(reflect(--r), R);
    }
    return monoid.merge(L, R);
  }

  value_t operator[](const int &k) {
    return query(k, k + 1);
  }
};
#line 6 "test/aoj/DSL_2_F.test.cpp"

#include <iostream>
#include <climits>
using namespace std;

using p_bi = pair<bool, int>;

int main() {
  int n, q; cin >> n >> q;
  // auto g=[](int a, p_bi b) -> int { return b.first ? monoid::min<int>().merge(a, b.second) : a; };
  auto g=[](int a, p_bi b) -> int { return b.first ? b.second : a; };
  LazySegmentTree<monoid::min<int>, monoid::fill<int>> st(g);
  st.build(vector<int>(n, INT_MAX));
  for (int i = 0; i < q; ++i) {
    int c; cin >> c;
    if (c == 0) {
      int s, t, x; cin >> s >> t >> x;
      st.update(s, t+1, {true, x});
      // std::cerr << s << " " << t << " " << x << endl;
      // for (int j = 0; j < n; ++j) cerr << j << " " << st[j] << endl;
    }
    else {
      int s, t; cin >> s >> t;
      cout << st.query(s, t+1) << endl;
    }
  }
}



Measured memory_bytes: 6212