#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
__attribute__((unused))
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
__attribute__((unused))
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
__attribute__((unused))
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
__attribute__((unused))
auto constexpr infty<int> = 1'100'100'100;
template<>
__attribute__((unused))
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

using namespace std;

template <typename T>
struct service {
  size_t L;
  std::vector<T> dat;
  std::vector<T> lazy;
  std::vector<T> mim;

  explicit service(size_t n, T x)
    : L(csqrt(n))
    , dat(L * L, x)
    , lazy(L, -1)
    , mim(L, x)
  { }

  void resolve(size_t g) {
    T val = lazy[g];
    if (val < 0) { return; }
    for (size_t i = g * L; i < (g + 1) * L; ++i) {
      dat[i] = val;
    }
    lazy[g] = -1;
  }

  void compute_mim(size_t g) {
    T ans = dat[g * L];
    for (size_t i = g * L; i < (g+1) * L; ++i) {
      chmin(ans, dat[i]);
    }
    mim[g] = ans;
  }

  void update(size_t begin, size_t end, T x) {
    resolve(begin / L);
    resolve(end / L);
    size_t i;
    for (i = begin; i < end && i % L != 0; ++i) {
      dat[i] = x;
    }
    compute_mim(begin / L);
    for (; i + L <= end; i += L) {
      lazy[i / L] = x;
      mim[i / L] = x;
    }
    for (; i < end; ++i) {
      dat[i] = x;
    }
    compute_mim(end / L);
  }

  T find(size_t begin, size_t end) {
    resolve(begin / L);
    resolve(end / L);
    T ans = infty<lli>;
    size_t i;
    for (i = begin; i < end && i % L != 0; ++i) {
      chmin(ans, dat[i]);
    }
    for (; i + L <= end; i += L) {
      chmin(ans, mim[i / L]);
    }
    for (; i < end; ++i) {
      chmin(ans, dat[i]);
    }
    return ans;
  }

  static size_t csqrt(size_t n) {
    size_t k = 1;
    while (k * k < n + 2) { ++k; }
    return k;
  }
};

int main() {
  // cout << fixed << setprecision(10);

  int N, Q; cin >> N >> Q;
  service<lli> srv(N, (1LL << 31) - 1);

  REP(query, Q) {
    //cerr << endl << stringify(srv.dat, srv.lazy, srv.mim, srv.L) << endl;
    int T; cin >> T;
    if (T == 0) {
      lli S, T, X; cin >> S >> T >> X;
      //cerr << "update: " << stringify(S, T, X) << endl;
      srv.update(S, T+1, X);
    } else {
      lli S, T; cin >> S >> T;
      //cerr << "find: " << stringify(S, T) << endl;
      cout << srv.find(S, T+1) << endl;
    }
  }

  return 0;
}



Measured memory_bytes: 3604