package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	q := getNextInt(scanner)
	seg := newSegment(n)
	seg.update(0, n, math.MaxInt32, seg.min)
	for i := 0; i < q; i++ {
		o := getNextInt(scanner)
		s := getNextInt(scanner)
		t := getNextInt(scanner) + 1
		switch o {
		case 0:
			x := getNextInt(scanner)
			seg.update(s, t, x, seg.min)
		case 1:
			ans := seg.query(s, t, math.MaxInt32, seg.min)
			fmt.Fprintln(writer, ans)
		}
	}
}

type vertex struct {
	v int
	p bool
}
type segment [][]vertex

func newSegment(n int) segment {
	seg := make(segment, 0)
	for n > 1 {
		seg = append(seg, make([]vertex, n))
		n = (n + 1) >> 1
	}
	seg = append(seg, make([]vertex, 1))
	return seg
}
func (seg segment) up(h, i int, f func(x, y int) int) {
	for h = h + 1; h < len(seg); h++ {
		i >>= 1
		if i<<1+1 < len(seg[h-1]) {
			seg[h][i].v = f(seg[h-1][i<<1].v, seg[h-1][i<<1+1].v)
		} else {
			seg[h][i].v = seg[h-1][i<<1].v
		}
	}
}
func (seg segment) propagate(h, i int) {
	if h >= len(seg) {
		return
	}
	seg.propagate(h+1, i>>1)
	if seg[h][i].p == false {
		return
	}
	seg[h][i].p = false
	seg[h-1][i<<1].v = seg[h][i].v
	seg[h-1][i<<1].p = true
	if i<<1+1 >= len(seg[h-1]) {
		return
	}
	seg[h-1][i<<1+1].v = seg[h][i].v
	seg[h-1][i<<1+1].p = true
}
func (seg segment) update(l, r int, v int, f func(x, y int) int) {
	for h := 0; h < len(seg) && l < r; h++ {
		if l&1 == 1 {
			seg.propagate(h+1, l>>1)
			seg[h][l].v = v
			seg[h][l].p = true
			seg.up(h, l, f)
			l++
		}
		l >>= 1
		if r&1 == 1 {
			seg.propagate(h+1, (r-1)>>1)
			seg[h][r-1].v = v
			seg[h][r-1].p = true
			seg.up(h, r-1, f)
		}
		r >>= 1
	}
}
func (seg segment) query(l, r int, s int, f func(x, y int) int) int {
	for h := 0; h < len(seg) && l < r; h++ {
		if l&1 == 1 {
			seg.propagate(h+1, l>>1)
			s = f(s, seg[h][l].v)
			l++
		}
		l >>= 1
		if r&1 == 1 {
			seg.propagate(h+1, (r-1)>>1)
			s = f(s, seg[h][r-1].v)
		}
		r >>= 1
	}
	return s
}
func (seg segment) add(x, y int) int {
	return x + y
}
func (seg segment) min(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func (seg segment) max(x, y int) int {
	return -seg.min(-x, -y)
}



Measured memory_bytes: 7780