### BUGGY CODE ###

import sys
import math
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1
lazy_init = (None,-1)
def lazy_tree_merge(lazy,tree,i,N):
    if(lazy[i][0] 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] = lazy_init

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,i)
        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)
    if(tree[k*2+1][1] < tree[k*2+2][1]):
        tree[k] = tree[k*2+2]
    else:
        tree[k] = tree[k*2+1]

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][0]

    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)
    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,-1)]*(2*N - 1)
        lazy_A = [lazy_init]*(2*N - 1)
    else:
        A = [(INT_MAX,-1)]*(2*N)
        lazy_A = [lazy_init]*(2*N)

    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[1]+1,0,0,N,N)
            print(z)



### FIXED CODE ###

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

def update(tree,x,y,z,N):
    left = x + N #- 1
    right = y + N#- 1

    while True:
        if(left >= right):
            break
        if(right % 2 == 1):
            right -= 1
            tree[right - 1] = z
        if(left % 2 == 1):
            tree[left - 1] = z
            left += 1

        #left += 1#math.floor((left + 1)/2)
        #right -= 1#math.floor((right - 1)/2)
        left >>= 1
        right >>= 1

def find(tree,x,N):
    x += N - 1
    s = (INT_MAX, -1)
    while True:
        if(x < 0):
            break
        if(tree[x][0] is not None and (tree[x][1] > s[1])):
            s = tree[x]
        x = math.floor((x - 1)/2)
    return s[0]

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    N = 1
    while True:
        if(N >= _N):
            break
        N *= 2
    A = [(None,-1)]*(2*N - 1)

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