#include<stdio.h>
#include<math.h>

#define MAXA 100003
#define MAX 2147483647

int a[MAXA], length[MAXA];

int b,n;
 
int min(int, int);
int max(int, int);
void update(int);



 
int main(){
 
    int i,j,x,y,z;
    int q, que; 
    
    scanf("%d %d",&n,&q);
    
    b = sqrt(n);
     
    for(i = 0;i < n;i ++)a[i]=MAX;
    for(i = 0;i < n;i ++)length[i]=-1;
     
    for(j = 0;j < q;j ++){
     
        scanf("%d",&que);

        if(que){
            scanf("%d",&x);
            if(length[x/b] != -1)update(x/b);
            printf("%d\n",a[x]);
        }
         
        else {
            scanf("%d %d %d",&x,&y,&z);
            
            if(length[x/b] != -1)update(x/b);
            for(i = x;i <= min(y,(x/b + 1) * b - 1);i ++)a[i] = z;
            for(i = x/b + 1;i < y/b;i ++)length[i] = z;
            if(length[y/b] != -1)update(y/b);
            for(i = max(x,y/b*b);i <= y;i ++)a[i] = z;
        }
         
    }
     
    return 0;
     
}

int min(int x,int y){
    if (x > y) return y;
    return x;   
}

int max(int x , int y){
    if (x > y) return x;
    return y;   
}


void update(int x){
    for(int i = x*b;i <= min(n-1,(x+1)*b-1);i ++)a[i] = length[x];
    length[x] = -1;
    return;
}


