#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int n, m, k;
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 ans[4000010][3], N = 0;

namespace SOLVE
{
	vector<int> poss[610];
	int stk[310][5], len[310];
	pair<int, int> pos[610]; // 0: top, 1: bot
	inline void op1(int x)
	{
		ans[++N][0] = 1, ans[N][1] = x;
	}
	inline void op2(int x, int e)
	{
		ans[++N][0] = 1, ans[N][1] = e;
		ans[++N][0] = 2, ans[N][1] = x, ans[N][2] = e;
		printf("1 %d\n", e);
		printf("2 %d %d\n", x, e);
	}
	inline int nxt(int x, int pos)
	{
		return *upper_bound(poss[x].begin(), poss[x].end(), pos);
	}
	void qwq()
	{
//		freopen("B.in", "r", stdin);
//		freopen("B.out", "w", stdout);
//		int T;
//		scanf("%d", &T);
//		while(T--)
//			int n, m, k;
//			scanf("%d %d %d", &n, &m, &k);
			for(int i = 1; i <= k; i++)
				poss[i].clear(), pos[i] = {0, 0};
			for(int i = 1; i <= n; i++)
			{
				len[i] = 0;
				stk[i][0] = stk[i][1] = stk[i][2] = 0;
			}
			for(int i = 1; i <= m; i++)
				poss[a[i]].push_back(i);
			set<int> emp, sz1;
			for(int i = 1; i <= n; i++)
				emp.insert(i);
			for(int i = 1; i <= m; i++)
			{
				int u = a[i];
				cout << "WORK " << u << endl;
				if(pos[u].first)
				{
					int p = pos[u].first;
					if(pos[u].second && len[p] > 1)
					{
						int e = *(emp.begin());
						op2(p, e);
						len[p]--;
						stk[p][0] = stk[p][1], stk[p][1] = stk[p][2], stk[p][2] = 0;
						pos[u] = {0, 0};
						if(len[p])
							pos[stk[p][0]] = {p, 1};
						if(!len[p])
							emp.insert(p), sz1.erase(p);
						if(len[p] == 1)
							sz1.insert(p);
					}
					else
					{
						op1(p);
						len[p]--, stk[p][len[p]] = 0;
						pos[u] = {0, 0};
						if(len[p] >= 2)
							pos[stk[p][len[p] - 1]] = {p, 0};
						if(!len[p])
							emp.insert(p), sz1.erase(p);
						if(len[p] == 1)
							sz1.insert(p);
					}
				}
				else
				{
					int e = *(emp.begin());
					if(!sz1.empty())
					{
						int p = *(sz1.begin());
						op1(p);
						stk[p][1] = u, len[p]++;
						pos[u] = {p, 0};
						sz1.erase(p);
					}
					else if(emp.size() >= 2)
					{
						op1(e);
						stk[e][0] = u, len[e]++;
						pos[u] = {e, 1};
						emp.erase(e), sz1.insert(e);
					}
					else // all 2
					{
						int p = 0;
						for(int j = 1; j <= n; j++)
							if(len[j])
							{
								int x = stk[j][0], y = stk[j][1];
								if(nxt(x, i) < nxt(y, i))
								{
									p = j;
									break;
								}
							}
						if(p)
						{
							op1(p);
							stk[p][2] = u, len[p]++;
							pos[u] = {p, 0};
						}
						else
						{
							op1(e);
							stk[e][0] = u, len[e]++;
							pos[u] = {e, 1};
							emp.erase(e), sz1.insert(e);
						}
					}
				}
			}
	}
}


int main()
{
//	srand(time(0));
srand(GetTickCount());
//	freopen("B.in", "w", stdout);
	printf("1\n");
	n = 3, m = 10, k = n * 2 - 1;
	printf("%d %d %d\n", n, m, k);
	for(int i = 1; i <= m; i++)
		b[i] = i;
	random_shuffle(b + 1, b + m + 1);
//	cerr << "wdnmd" << endl;
	for(int i = 1; i <= m; i += 2)
	{
		int x = Rand(1, k);
		a[b[i]] = a[b[i + 1]] = x;
	}
	for(int i = 1; i <= m; i++)
		printf("%d ", a[i]);
	putchar('\n');
	cerr << "QWQ" << endl;
	SOLVE :: qwq();
	
	int pos = 1;
	cout << N << endl;
	for(int i = 1; i <= N; i++)
	{
		int op = ans[i][0];
		cout << "OP" << op << endl;
		if(op == 1)
		{
			int x = ans[i][1];
			cout << x << endl;
			int u = a[pos++];
			if(!q[x].empty() && q[x].back() == u)
				q[x].pop_back(), cout << "QWQ" << endl;
			else
				q[x].push_back(u);
		}
		else
		{
			int x = ans[i][1], y = ans[i][2];
			cout << x << ' ' << y << endl;
			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;
}