import sys
import math
import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1
def lazy_tree_merge(lazy,tree,i,N):
    if(lazy[i] is not None):
        tree[i] = lazy[i]
        if(i < N-1):
            lazy[i*2+1] = lazy[i]
            lazy[i*2+2] = lazy[i]
        lazy[i] = None

def update(tree,lazy,x,y,k,l,r,i,z,N):
    if (r <= x or y <= l):
        lazy_tree_merge(lazy,tree,k,N)
        return True
    if ( x <= l and r <= y):
        lazy[k] = z
        lazy_tree_merge(lazy,tree,k,N)
        return True

    lazy_tree_merge(lazy,tree,k,N)
    center = int((l+r)/2)
    update(tree, lazy, x, y, k*2 + 1, l, center, i, z, N)
    #update(tree, lazy, x, y, k*2 + 2, l, int((l+r)/2), i, z, N)
    update(tree, lazy, x, y, k*2 + 2, center, r, i, z, N)
    tree[k] = min(tree[k*2+1],tree[k*2+2])

def find(tree,lazy,x,y,k,l,r,N):

    if (r <= x or y <= l):
        return INT_MAX
    if ( x <= l and r <= y):
        lazy_tree_merge(lazy,tree,k,N)
        return tree[k]

    lazy_tree_merge(lazy,tree,k,N)
    v_left = find(tree, lazy_A, x, y, k*2 + 1, l, int((l+r)/2), N)
    v_right = find(tree, lazy_A, x, y, k*2 + 2, int((l+r)/2), r, N)
    #print(v_left)
    #print(v_right)
    return min(v_left, v_right)

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    N = 1
    while True:
        if(N >= _N):
            break
        N <<= 1
    if not (N == 1):
        A = [INT_MAX]*(2*N - 1)
        lazy_A = [None]*(2*N - 1)
    else:
        A = [INT_MAX]*(2*N)
        lazy_A = [None]*(2*N)
    #start = time.time()
    for i in range(query_num):
        query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            update(A,lazy_A,query[1],query[2]+1,0,0,N,i,query[3],N)
            #print(A,lazy_A)
        # find
        if(query[0]==1):
            z = find(A,lazy_A,query[1],query[2]+1,0,0,N,N)
            print(z)
    #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]))