#include <bits/stdc++.h>
typedef long long LL;

const int MAXN = 600 + 5, MAXM = 2e6 + 5;
int t, n, m, k, a[MAXM], sta[MAXN][150010], cnt[MAXN], Pre[MAXN];

int Read()
{
	int sum = 0, fh = 1; char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) fh -= (ch == '-') << 1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) sum = (sum << 3) + (sum << 1) + (ch ^ 48);
	return sum * fh;
}

int main()
{
	freopen("meow.in", "r", stdin);
	t = Read(), n = Read(), m = Read(), k = Read();
	for (int i = 1; i <= m; ++i) a[i] = Read();
	for (int i = 1; i <= n; ++i) Pre[i] = 1;
	fclose(stdin); freopen("meow.out", "r", stdin);
	int opt = Read(), zp = 0;
	while (opt--)
	{
		int pz = Read();
		if (pz == 1)
		{
			int x = Read(); ++zp;
			if (x < 1 || x > n) { puts("Wrong, (1, x) out of range."); return 0; }
			if (x == n) { puts("Warning, (1, x) is n."); }
			++cnt[x]; sta[x][cnt[x]] = a[zp];
			if (cnt[x] > Pre[x] && sta[x][cnt[x]] == sta[x][cnt[x] - 1]) cnt[x] -= 2;
			if (cnt[x] < Pre[x]) { puts("Wrong, (1, x) has one empty stack."); return 0; }
		}
		if (pz == 2)
		{
			int x = Read(), y = Read();
			if (x < 1 || x > n || y < 1 || y > n) { puts("Wrong, (2, x, y) is out of range."); return 0; }
			if (x == y) { puts("Wrong, (2, x == y)."); return 0; }
			if (Pre[x] > cnt[x] || Pre[y] > cnt[y]) { puts("Wrong, (2, x, y) has one empty stack."); return 0; }
			if (sta[x][Pre[x]] == sta[y][Pre[y]]) { ++Pre[x], ++Pre[y]; }
			else { puts("Wrong, (2, x, y), a[x] != a[y]."); return 0; }
		}
	}
	for (int i = 1; i <= n; ++i) if (Pre[i] <= cnt[i]) { printf("Wrong, %d stack is not empty.\n", i); return 0; }
	puts("Accepted.");
}