#include <bits/stdc++.h>



int next(vector<ll> &a, ll y, vector<bool> &visited){
	ll last = a[0];
	


	if(y==1) return 1;

	if(a[y] != last){
		cout << y  << "\n";
		visited[y-1] = 1;
		last = a[y-1];

	}else{

		
	}
}

typedef long long ll;
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);

	ll n,q;
	cin >> n >> q;

	vector<ll> a(n);

	vector<ll> a2(n);

	visited[0] = 1;

	for(int i = 0; i < n; i++){
		cin >> a[i];
	}

	for(int i = 0; i < q; ++i) {
		ll t;
		cin >> t;

		if(t == 1 and i != q-1) swap(a[i], a[i+1]);

	if(t==2){
		ll y;
		cin >> y;

		if(y==1) cout << 1 << "\n";
			
		}
	}

	return 0;

}