use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let mut scan = Scanner::new(cin.lock());

    let n = scan.read::<usize>();
    let q = scan.read::<usize>();
    let v = vec![(1i64<<31) - 1; n];
    let mut segtree = SegRangeUpdate::new(v, (1i64<<31)-1, std::cmp::min);
    for _ in 0..q {
        let com = scan.read::<i32>();
        if com == 0 {
            let s = scan.read::<usize>();
            let t = scan.read::<usize>();
            let x = scan.read::<i64>();
            segtree.set(s..t+1, x);
        } else {
            let s = scan.read::<usize>();
            let t = scan.read::<usize>();
            println!("{}", segtree.get(s..t+1));
        }
    }
}

use std::ops::Range;

fn contains(p: &Range<usize>, q: &Range<usize>) -> bool {
    p.start <= q.start && q.end <= p.end
}

fn separates(p: &Range<usize>, q: &Range<usize>) -> bool {
    p.end <= q.start || q.end <= p.start
}

fn size(p: &Range<usize>) -> usize {
    p.end - p.start
}

struct SegRangeUpdate<'a> {
    node: Vec<i64>,
    lazy: Vec<i64>,
    has_lazy: Vec<bool>,
    op: Box<Fn(i64, i64) -> i64 + 'a>,
    zero: i64,
    n: usize,
}

impl <'a> SegRangeUpdate<'a> {
    fn new<B>(v: Vec<i64>, zero: i64, op: B) -> SegRangeUpdate<'a> where B: Fn(i64, i64) -> i64 + 'a {
        let size = v.len();
        let mut n = 1usize;
        while n < size {n *= 2}
        let mut node = vec![zero; 2*n-1];
        let lazy = vec![0; 2*n-1];
        let has_lazy = vec![false; 2*n-1];
        for i in 0..size {node[i+n-1] = v[i]}
        for i in (0..n - 1).rev() {node[i] = op(node[i*2+1], node[i*2+2])}
        SegRangeUpdate {node: node, lazy: lazy, has_lazy: has_lazy, op: Box::new(op), zero, n: n}
    }

    fn eval(&mut self, k: usize, range: Range<usize>) {
        if self.has_lazy[k] {
            self.node[k] = self.lazy[k];
            if size(&range) > 1 {
                self.lazy[2*k+1] = self.lazy[k];
                self.lazy[2*k+2] = self.lazy[k];
                self.has_lazy[2*k+1] = true;
                self.has_lazy[2*k+2] = true;
            }
            self.has_lazy[k] = false;
        }
    }

    fn set(&mut self, query: Range<usize>, x: i64) {
        let n = self.n;
        self.setrec(query, x, 0,  0..n )
    }

    fn setrec(&mut self, query: Range<usize>, x: i64, k: usize, range: Range<usize>) {
        self.eval(k, range.clone());
        if separates(&query, &range) {return}
        if contains(&query, &range) {
            self.lazy[k] = x;
            self.has_lazy[k] = true;
            self.eval(k, range.clone());
        } else {
            self.setrec(query.clone(), x, 2*k+1, range.start..(range.start+range.end)/2);
            self.setrec(query.clone(), x, 2*k+2, (range.start+range.end)/2..range.end);
            self.node[k] = (self.op)(self.node[2*k+1], self.node[2*k+2]);
        }
    }

    fn get(&mut self, query: Range<usize>) -> i64 {
        let n = self.n;
        self.getrec(query, 0, 0..n)
    }

    fn getrec(&mut self, query: Range<usize>, k: usize, range: Range<usize>) -> i64 {
        if separates(&query, &range) {return self.zero}
        self.eval(k, range.clone());
        if contains(&query, &range) {return self.node[k]}
        let vl = self.getrec(query.clone(), 2*k+1, range.start..(range.start+range.end)/2);
        let vr = self.getrec(query.clone(), 2*k+2, (range.start+range.end)/2..range.end);
        (self.op)(vl, vr)
    }
}


// region template
#[allow(dead_code)]
fn uz(i: i32) -> usize { i as usize }

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }

    fn readn<T: FromStr>(&mut self, n: i32) -> Vec<T> {
        let mut ret = vec![];
        for _ in 0..n { ret.push(self.read::<T>()) }
        ret
    }

    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion


Measured memory_bytes: 9128