### BUGGY CODE ###

import sys
import math
#import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1

def tree_propagate(tree,lazy,k,N):
    if(lazy[k] is None):
        return
    if(k < N // 2):
        tree[k*2+1] = tree[k*2+2] = lazy[k]
        lazy[k*2+1] = lazy[k*2+2] = lazy[k]
        lazy[k] = None
        return
    if(k < N-1):
        tree[k*2+1] = tree[k*2+2] = lazy[k]
        lazy[k] = None

def update(tree,lazy,s,t,x,k,l,r,N):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        tree[k] = x
        if(k < N-1):
            lazy[k] = x
        #tree_propagate(tree,lazy,k,N)
        return

    tree_propagate(tree,lazy,k,N)
    center = int((l+r)/2)
    update(tree, lazy, s, t, x, k*2 + 1, l, center, N)
    update(tree, lazy, s, t, x, k*2 + 2, center, r, N)

    tree[k] = min(tree[k*2+1], tree[k*2+2])

def find(tree,lazy,s,t,k,l,r,N):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return tree[k]

    tree_propagate(tree,lazy,k,N)
    center = int((l+r)/2)
    v_left = find(tree, lazy, s, t, k*2 + 1, l, center, N)
    v_right = find(tree, lazy, s, t, k*2 + 2, center, r, N)
    return min(v_left,v_right)

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    queries = [list(map(int, input().split())) for i in range(query_num)]
    N = 1
    while True:
        if(N >= _N):
            break
        N <<= 1

    A = [INT_MAX]*(2*N - 1)
    lazy_A = [None]*(2*N - 1)
    #start = time.time()
    answers = []
    #for i in range(query_num):
    for query in queries:
        #query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            update(A,lazy_A,query[1],query[2]+1,query[3],0,0,N,N)
        # find
        if(query[0]==1):
            z = find(A,lazy_A,query[1],query[2]+1,0,0,N,N)
            answers.append(z)
            #print(z)
    for ans in answers:
        print(ans)
    #elapsed_time = time.time() - start
    #print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")



### FIXED CODE ###

import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))