#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;

const int N = 605, M = 2e6 + 5;

int n, m, K;
int sz[M];
int a[M];
vi e[N];

void task()
{
	scanf("%d", &m);
	for (int i = 1; i <= m; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= 10; i++)
		vi().swap(e[i]);
	scanf("%d", &n);
	memset(sz, 0, sizeof(sz));
	int pos = 0;
	for (int i = 1; i <= n; i++)
	{
		int op, x, y;
		scanf("%d%d", &op, &x);
		if (op == 1)
		{
			int v = a[++pos];
			
			if (!e[x].empty() && e[x].back() == v)
				e[x].pop_back();
			else e[x].push_back(v);
		}
		else
		{
			scanf("%d", &y);
			if (*e[x].begin() == *e[y].begin())
				e[x].erase(e[x].begin()),
				e[y].erase(e[y].begin());
		}
			
		int mx = 0;
		for (int i = 1; i <= 10; i++)
			mx = max(mx, (int)e[i].size());
		printf("maxsize=%d\n",mx);
	}
}

int main()
{
	freopen("test.in", "r", stdin);
	freopen("tmp.out", "w", stdout);
//	scanf("%d", &T);
	task();
}