Problem: Write a program which manipulates a sequence A = {a0, a1, . . . , an−1} with the following operations:

* update(s, t, x): change as, as+1, ..., at to x.
* find(i): output the value of ai.



Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.

Constraints

* 1 ≤ n ≤ 100000
* 1 ≤ q ≤ 100000
* 0 ≤ s ≤ t < n
* 0 ≤ i < n
* 0 ≤ x < 231−1

Input


n q
query1
query2
:
queryq


In the first line, n (the number of elements in A) and q (the number of queries) are given. Then, ith query queryi is given in the following format:


0 s t x


or


1 i


The first digit represents the type of the query. '0' denotes update(s, t, x) and '1' denotes find(i).

Output

For each find operation, print the value.

Examples

Input

3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0
1 1


Output

1
3


Input

1 3
1 0
0 0 0 5
1 0


Output

2147483647
5

Solution (in CPP):

Solution:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define chmax(a,b) a=max(a,b);
#define chmin(a,b) a=min(a,b);
class Segtree{
	
	private:
	int V;
	typedef struct st{
		ll a;
	}st;
	st st0=(st){(ll)1e18};
	typedef struct op{
		ll a;
	}op;
	op op0=(op){-1};
	st f(st p,st q){
		return (st){min(p.a,q.a)};
	}
	void g(st &p,op q){
		if(q.a==-1)return;
		p.a=q.a;
	}
	void h(op &p,op q){
		if(q.a==-1)return;
		p.a=q.a;
	}
	
	st *dat;
	op *laz;
	
	st propagate(ll k){
		if(k<V){
			h(laz[k*2],laz[k]);
			h(laz[k*2+1],laz[k]);
		}
		g(dat[k],laz[k]);
		laz[k]=op0;
		return dat[k];
	}
	void upd(ll l,ll r,op p){
		l+=V,r+=V+1;
		for(ll d=20;d>=0;d--){
			propagate(l>>d);
			propagate(r>>d);
		}
		for(ll a=l,b=r;a<b;a>>=1,b>>=1){
			if(a&1){h(laz[a],p);a++;}
			if(b&1){b--;h(laz[b],p);}
		}
		for(ll a=l,b=r;a+b;a>>=1,b>>=1){
			dat[a/2]=f(propagate(a/2*2),propagate(a/2*2+1));
			dat[b/2]=f(propagate(b/2*2),propagate(b/2*2+1));
		}
	}
	st qry(ll l,ll r){
		l+=V,r+=V+1;
		for(ll d=20;d>=0;d--){
			propagate(l>>d);
			propagate(r>>d);
		}
		st L=st0,R=st0;
		for(ll a=l,b=r;a<b;a>>=1,b>>=1){
			if(a&1){L=f(L,propagate(a));a++;}
			if(b&1){b--;R=f(propagate(b),R);}
		}
		st res=f(L,R);
		return res;
	}
	
	public:
	void init(int ns){
		V=1;
		while(V<=ns)V*=2;
		dat=new st[2*V];
		laz=new op[2*V];
		for(int i=0;i<2*V;i++){
			dat[i]=st0;
			laz[i]=op0;
		}
	}
	void update(ll l,ll r,ll a){
		upd(l,r,(op){a});
	}
	ll query(ll l,ll r){
		st res=qry(l,r);
		return res.a;
	}
};
Segtree seg;

int main(){
	int n,q;
	cin>>n>>q;
	seg.init(n);
	rep(i,n)seg.update(i,i,2147483647);
	while(q--){
		ll p,s,t,x;
		cin>>p;
		if(p==0){
			cin>>s>>t>>x;
			seg.update(s,t,x);
		}
		if(p==1){
			cin>>s;
			cout<<seg.query(s,s)<<"\n";
		}
	}
}