#include<iostream>
using namespace std;
int main()
{
	int N, Q, niz[N], t, u, v, l, x;
	cin>>N>>Q;
	for (int j=0; j<N; j++)
    {
        niz[j]=j+1;
    }
    int k=1;
    while (k<=Q)
    {
    	cin>>t;
    	if(t==1)
    	{
    		cin>>u>>v>>l;
    		for(int i=0; i<l; i++) niz[u+i-1]=niz[v+i-1];
		}
		else
		{
			cin>>x;
			cout<<niz[x-1]<<endl;
		}
		k++;
	}
	return 0;
}