import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class TestGen {

	class Test {
		int[] a;

		public Test(int... a) {
			this.a = a;
		}

	}

	private int testCount = 0;

	private void write(Test t) {
		try {
			++testCount;
			String filename = testCount / 10 + "" + testCount % 10;
			PrintWriter out = new PrintWriter(filename);
			out.println(t.a.length);
			for (int i = 0; i < t.a.length; i++) {
				out.print(t.a[i]);
				if (i != t.a.length - 1) {
					out.print(" ");
				}
			}
			out.println();
			System.err.println(testCount);
			out.flush();
			out.close();
		} catch (IOException ex) {
			throw new RuntimeException(ex);
		}
	}

	void myAssert(boolean b) {
		if (!b)
			throw new AssertionError();
	}

	int solve(Test t) {
		try {
			PrintWriter pw = new PrintWriter("divisigame.in");
			pw.println(t.a.length);
			for (int i : t.a) {
				pw.print(i + " ");
			}
			pw.println();
			pw.close();
			divisigame_sm.main(null);
			Scanner in = new Scanner(new File("divisigame.out"));
			String s = in.nextLine();
			in.close();
			if (s.equals("FIRST")) {
				return 1;
			} else if (s.equals("SECOND")) {
				return 2;
			} else if (s.equals("DRAW")) {
				return 0;
			} else {
				throw new AssertionError();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			throw new AssertionError(e);
		}
	}

	static Random rand = new Random(1);
	final int MAXN = 50;
	final int MAXX = 1000;

	public void run() throws IOException {
		write(new Test(0));
		write(new Test(1));
		write(new Test(2));
		write(new Test(3));
		write(genEqual(50, 0));
		write(genEqual(50, 1));
		write(genEqual(50, 2));
		write(genEqual(50, 3));
		for (int i = 0; i < 9; i++) {
			write(genRandWithAnswer(5, 10, i % 3));
		}
		for (int i = 0; i < 9; i++) {
			write(genRandWithAnswer(10, 3, i % 3));
		}

		for (int i = 0; i < 9; i++) {
			write(genRandWithAnswer(MAXN, MAXX, i % 3));
		}
	}

	Test genEqual(int n, int x) {
		int[] a = new int[n];
		Arrays.fill(a, x);
		return new Test(a);
	}

	Test genRand(int n, int l, int r) {
		int[] a = new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt(l, r);
		}
		return new Test(a);
	}

	Test genRandWithAnswer(int n, int l, int r, int answer) {
		for (int it = 0; it < 100; it++) {
			Test t = genRand(n, l, r);
			if (solve(t) == answer) {
				return t;
			}
		}
		System.err.print("[" + answer + "]");
		return null;
	}

	Test genRandWithAnswer(int maxn, int maxsize, int answer) {
		System.err.println("maxn = " + maxn + " maxsize = " + maxsize + " answer = " + answer);
		int l = rand.nextInt(2 * maxsize) - maxsize;
		int r = l + rand.nextInt(maxsize + 1 - l);
		while (true) {
			Test t = genRandWithAnswer(rand.nextInt(maxn) + 1, l, r, answer);
			if (t == null)
				continue;
			return t;
		}
	}

	int nextInt(int l, int r) {
		return l + rand.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new TestGen().run();
	}

}
