### BUGGY CODE ###

import sys
import math
import time
sys.setrecursionlimit(20000)
def update(Set,x,y,z):
    for i in range(x,y+1):
        Set[i] = z

def lazy_update(Set,i,x):
    Set[i] = x

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    N = 1
    sqrtN = 1
    while True:
        if(N >= _N):
            break
        sqrtN += 1
        N = sqrtN**2
    A = [2**31 - 1]*N
    lazy_A = [None]*sqrtN
    #start = time.time()
    for i in range(query_num):
        query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            for i in range(0,sqrtN):
                if((i+1)*sqrtN <= query[1] or query[2] <= i*sqrtN):
                    pass
                if(query[1] <= i*sqrtN and (i+1)*sqrtN <= query[2]):
                    if not (lazy_A[i] == query[3]):
                        lazy_update(lazy_A,i,query[3])
                else:
                    if(lazy_A[i] is not None):
                        A[i*sqrtN:(i+1)*sqrtN] = [lazy_A[i]]*sqrtN
                        lazy_A[i] = None
                    n = max(query[1],i*sqrtN)
                    m = min(query[2],(i+1)*sqrtN)
                    #print("max from {0} {1}".format(query[1],i*sqrtN))
                    #print("min from {0} {1}".format(query[2],(i+1)*sqrtN))
                    #print(n,m)
                    update(A,n,m,query[3])
                    #update(A,(i+1)*sqrtN+1,query[2],query[3])
            #print(A)
        # find
        if(query[0]==1):
            if(lazy_A[int(query[1]/sqrtN)] is not None):
                A[int(query[1]/sqrtN)*sqrtN:int(query[1]/sqrtN)*sqrtN+sqrtN] = [lazy_A[int(query[1]/sqrtN)]]*sqrtN
                lazy_A[int(query[1]/sqrtN)] = None
                #print("A update from lazy")
                #print(A)
            print(A[query[1]])
    #elapsed_time = time.time() - start
    #print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")



### 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]")