#include <bits/stdc++.h>
using namespace std;
int a[2000010], b[2000010];
inline int Rand()
{
	return rand() * 32768 + rand();
}
inline int Rand(int l, int r)
{
	return Rand() % (r - l + 1) + l;
}
deque<int> q[310];
int main()
{
	srand(time(0));
	freopen("meow.in", "r", stdin);
	int n, m, k;
	scanf("%d %d %d", &n, &m, &k);
	for(int i = 1; i <= m; i++)
		scanf("%d", &a[i]);
	freopen("meow.out", "r", stdin);
	cerr << "qwq" << endl;
	freopen("CON", "w", stdout);
	int N, pos = 1;
	scanf("%d", &N);
	while(N--)
	{
		int op;
		scanf("%d", &op);
		if(op == 1)
		{
			int x;
			scanf("%d", &x);
			int u = a[pos++];
			if(!q[x].empty() && q[x].back() == u)
				q[x].pop_back();
			else
				q[x].push_back(u);
		}
		else
		{
			int x, y;
			scanf("%d %d", &x, &y);
			if(q[x].empty() || q[y].empty() || q[x].front() != q[y].front())
			{
				cout << "G" << endl;
				return 0;
			}
			q[x].pop_front(), q[y].pop_front();
		}
	}
	for(int i = 1; i <= n; i++)
		if(!q[i].empty())
		{
			cout << "GG " << endl;
			return 0;
		}
	cout << "win" << endl;
	return 0;
}