#include<stdio.h>
#include<math.h>
#include<limits.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MAX 100001

int a[MAX];
int lazy[MAX];
int b,n;

void update(int x){

	for(int i=x*b;i<=MIN(n-1,(x+1)*b-1);i++){
		a[i]=lazy[x];
	}
	lazy[x]=-1;
	
	return;
}

int main(){

	int q,i,j,com;
	int x,y,z;
	
	scanf("%d %d",&n,&q);
	
	b=sqrt(n);
	
	for(i=0;i<n;i++){
		a[i]=INT_MAX;
		lazy[i]=-1;
	}
	
	for(j=0;j<q;j++){
	
		scanf("%d",&com);
		
		if(com==1){/*find*/
			scanf("%d",&x);
			if(lazy[x/b]!=-1)update(x/b);
			printf("%d\n",a[x]);
		}
		
		else {/*update*/
			scanf("%d %d %d",&x,&y,&z);
			if(lazy[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++)lazy[i]=z;
			
			if(lazy[y/b]!=-1)update(y/b);
			for(i=MAX(x,y/b*b));i<=y;i++)a[i]=z;
		}
		
	}
	
	return 0;
	
}
