#pragma GCC optimize("O3")
#include <iostream>
#include <vector>
#include <numeric>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target("avx2,avx,popcnt,lzcnt,sse4.2,sse4.1,sse4")
#pragma GCC optimize("unroll-loops")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned int uint;
using ordered_set = tree<ll, nullptr_t, less<ll>, rb_tree_tag, tree_order_statistics_node_update, allocator<ll>>;

struct man {
	int idx;
	int color;
	int next_uneq;
	man(int idx = 0, int color = 0): idx(idx), color(color) {}
};

int main() {
	cout.tie(0);
	cin.tie(0);
	ios::sync_with_stdio(0);
	int n, q;
	cin >> n >> q;
	vector<man> a(n); // pair<idx, color>;
	vector<int> color(n);
	for (int i = 0; i < n; ++i) {
		a[i].idx = i;
		cin >> a[i].color;
		a[i].color--;
	}
	for (int iq = 0; iq < q; ++iq) {
		int t, x;
		cin >> t >> x;
		--x;
		if (t == 1) {
		} else {
			cout << x+1 << '\n';
		}
	}
	

	return 0;
}
