#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int N = 1 << 17;

//?????????????????????0?§???????
//????°????????±???????????????°??????(RMQ)

//?????°???????????¨???????????°??????????????????

int n,n_,q,ud[2*N-1],t[2*N-1];

//?????????
//n_???x??\??????????°????2????????????
void init(int x)
{
	//?°????????????????????´???°???2???????????????
	n_=1;
	while(n_<x){
		n_*=2;
	}
	rep(i,2*n_-1){
		ud[i] = (int)((1LL<<31) -1LL);
		t[i] = -1;
	}
}

//k????????????????????§??????
int find(int k)
{
	P res;
	//????????????
	k += n_-1;
	res.first = ud[k];
	res.second = t[k];
	//?????????????????´??°
	while(k>0){
		k = (k-1)/2;
		if(t[k] > res.second){
			res.first = ud[k];
			res.second = t[k];
		}	
	}
	return res.first;
}

//[a,b)???????°????????±??????????
//k??????????????????
//????????????query(a,b,0,0,n_)??¨???????????¶???(n_??¨???????????¨?????¨???)
void update(int a,int b,int k,int l,int r,int val,int id)
{
	if(r <= a || b <= l){
		return;
	}
	if(a <= l && r <= b){
		ud[k] = val;
		t[k] = id;
	}else{
		update(a,b,2*k+1,l,(l+r)/2,val,id);
		update(a,b,2*k+2,(l+r)/2,r,val,id);
	}
}
int main()
{
	scanf("%d%d",&n,&q);
	init(n);
	rep(i,q){
		int x;
		scanf("%d",&x);
		if(x==0){
			int s,t,u;
			scanf("%d%d%d",&s,&t,&u);
			update(s,t+1,0,0,n_,u,i);
		}else{
			int s;
			scanf("%d",&s);
			printf("%d\n",find(s));
		}
	}
	return 0;
}
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int N, Q;
int main() {
	scanf("%d%d", &N, &Q);
	vector<int> tp(Q), s(Q), t(Q), x(Q);
	for (int i = 0; i < Q; i++) {
		scanf("%d%d", &tp[i], &s[i]);
		if (tp[i] == 0) scanf("%d%d", &t[i], &x[i]), t[i]++;
	}
	vector<int> d(N, 2147483647);
	int B = sqrt(Q);
	for (int i = 0; i < B; i++) {
		int l = 1LL * i * Q / B, r = 1LL * (i + 1) * Q / B;
		for (int j = l; j < r; j++) {
			if (tp[j] == 1) {
				bool flag = false;
				for (int k = j - 1; k >= l; k--) {
					if (tp[k] == 0 && s[k] <= s[j] && s[j] < t[k]) {
						printf("%d\n", x[k]); flag = true;
						break;
					}
				}
				if (!flag) printf("%d\n", d[s[j]]);
			}
		}
		vector<int> cp = { 0, N };
		for (int j = l; j < r; j++) {
			if (tp[j] == 0) {
				cp.push_back(s[j]);
				cp.push_back(t[j]);
			}
		}
		sort(cp.begin(), cp.end());
		cp.erase(unique(cp.begin(), cp.end()), cp.end());
		vector<int> f(cp.size() - 1, -1);
		for (int j = l; j < r; j++) {
			if (tp[j] == 0) {
				int pl = lower_bound(cp.begin(), cp.end(), s[j]) - cp.begin();
				int pr = lower_bound(cp.begin(), cp.end(), t[j]) - cp.begin();
				for (int k = pl; k < pr; k++) f[k] = x[j];
			}
		}
		for (int j = 0; j < cp.size() - 1; j++) {
			if (f[j] != -1) {
				for (int k = cp[j]; k < cp[j + 1]; k++) d[k] = f[j];
			}
		}
	}
	return 0;
}