#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

#define NUM 2147483647

int N = 1;
int* data;

void init(int first_N){
	while(N < first_N)N *= 2;
}

void update(int update_left,int update_right,int new_value,int node_id,int node_left,int node_right){
	if(update_right < node_left || update_left > node_right)return;
	else if(update_left <= node_left && update_right >= node_right){
		data[node_id] = new_value;
	}else{
		if(data[node_id] >= 0){
			data[2*node_id+1] = data[node_id];
			data[2*node_id+2] = data[node_id];
			data[node_id] = -1;
		}
		update(update_left,update_right,new_value,2*node_id+1,node_left,(node_left+node_right)/2);
		update(update_left,update_right,new_value,2*node_id+2,(node_left+node_right)/2+1,node_right);
	}
}

int query(int search_left,int search_right,int node_id,int node_left,int node_right){
	if(search_right < node_left || search_left > node_right){
		return -1;
	}else if(node_left <= search_left && node_right >= search_right && data[node_id] >= 0){
		return data[node_id];
	}else{
		int left = query(search_left,search_right,2*node_id+1,node_left,(node_left+node_right)/2);
		int right = query(search_left,search_right,2*node_id+2,(node_left+node_right)/2+1,node_right);
		return max(left,right);
	}
}

int main(){
	int first_N,Q;
	scanf("%d %d",&first_N,&Q);

	init(first_N);

	data = new int[270000];

	for(int i = 0; i <= 2*N-2; i++)data[i] = NUM;

	int command,left,right,value,loc;

	for(int i = 0; i < Q; i++){
		scanf("%d",&command);

		if(command == 0){
			scanf("%d %d %d",&left,&right,&value);
			update(left,right,value,0,0,N-1);
		}else{
			scanf("%d",&loc);
			printf("%d\n",query(loc,loc,0,0,N-1));
		}
	}
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define INIVAL 2147483647

int *a, *ts, c, s, t, v;

void update(int k, int l, int r)
{
  if (r<s || t<=l) return;
  if (s<=l && r<=t) {
    a[k] = v;
    ts[k] = c;
  } else if (l<r-1) {
    update(((k+1)<<1)-1, l, (l+r)>>1);
    update((k+1)<<1, (l+r)>>1, r);
  }
}

int main()
{
  int i, k, n, z, w, latest;
  char *p,buf[64] = {0};
  buf[62] = '\n';
  fgets(buf, 64, stdin);
  for (n=0,p=buf; *p>' '; n=n*10+*(p++)-'0');
  w = n>1 ? pow(2,(int)ceil(log2(n)))-1 : 1;
  ts = (a = (int*)malloc((w+n)*2*sizeof(int))) + w+n;
  for (i=0; i<w+n; i++)  ts[i] = -1;
  a[0] = INIVAL;
  ts[0] = 0;
  c = 0;
  while (fgets(buf, 64, stdin)) {
    for (s=0,p=buf+2; *p>' '; s=s*10+*(p++)-'0');
    if (*buf=='0') { // update(s, t, x)
      for (t=0,p++; *p>' '; t=t*10+*(p++)-'0');
      for (v=0,p++; *p>' '; v=v*10+*(p++)-'0');
      t++;
      update(0, 0, w+1);
      c++;
    } else { // find(x) x->s
      latest = -1;
      for (k=w+s; ; k=(k-1)>>1) {
	if (ts[k]>latest) {
          latest = ts[k];
          z = a[k];
        }
	if (k==0) break;
      }
      if (z<10) {
	putc_unlocked('0'+z, stdout);
	putc_unlocked('\n', stdout);
      } else {
        for (i=62; z>0; buf[--i]='0'+z%10,z/=10);
        fputs(buf+i, stdout);
      }
    }
  }
  return 0;
}

