#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int sz;
pair<int, int> tree[4*N];
void init(int n)
{
sz=1;
while(sz<n)
sz*=2;
}
int query(int i, int node, int lx, int rx)
{
if(rx-lx==1)
return tree[node].first;
int mid=(lx+rx)/2;
if(tree[2*node+1].second<tree[node].second)
tree[2*node+1]=tree[node];
if(tree[2*node+2].second<tree[node].second)
tree[2*node+2]=tree[node];
tree[node]={0, 0};
if(i<mid)
return query(i, 2*node+1, lx, mid);
return query(i, 2*node+2, mid, rx);
}
void update(int l, int r, int v, int node, int lx, int rx, int no)
{
if(lx>=r || rx<=l)
return;
if(lx>=l && rx<=r)
{
tree[node]={v, no};
return;
}
int mid=(lx+rx)/2;
update(l, r, v, 2*node+1, lx, mid, no);
update(l, r, v, 2*node+2, mid, rx, no);
}
void solve()
{
int n, m;
cin>>n>>m;
for(int i=0;i<4*N;i++)
tree[i]={0, 0};
init(n);
int up=0;
while(m--)
{
int op;
cin>>op;
if(op==2)
{
int i;
cin>>i;
int ans=query(i, 0, 0, sz);
cout<<ans<<endl;
}
else
{
int l, r, v;
cin>>l>>r>>v;
update(l, r, v, 0, 0, sz, ++up);
}
}
}
signed main() {
// int t;cin>>t;while(t--)
solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKY29uc3QgaW50IE49MmU1KzU7CmludCBzejsKcGFpcjxpbnQsIGludD4gdHJlZVs0Kk5dOwogCnZvaWQgaW5pdChpbnQgbikKewoJc3o9MTsKCXdoaWxlKHN6PG4pCgkJc3oqPTI7Cn0KIAppbnQgcXVlcnkoaW50IGksIGludCBub2RlLCBpbnQgbHgsIGludCByeCkKewoJaWYocngtbHg9PTEpCgkJcmV0dXJuIHRyZWVbbm9kZV0uZmlyc3Q7CglpbnQgbWlkPShseCtyeCkvMjsKCWlmKHRyZWVbMipub2RlKzFdLnNlY29uZDx0cmVlW25vZGVdLnNlY29uZCkKCQl0cmV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