import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Random;

public class gen_arithm {
	public static void main(String[] args) throws IOException {
		sample();
		minTest();
		minEqualTest();
		hugeEqualTest();
		hugeAlmostTwoSeq(9180, 10080);
		hugeAlmostTwoSeq(10010 / 13, 10010);
		for (int i = 0; i < 3; i++) {
			hugeAlmostTwoSeq(rand.nextInt(BOUND + 1), rand.nextInt(BOUND + 1));
		}
		hugeAlmostTwoSeq(2556, 2556);
		for (int i = 0; i < 3; i++) {
			int d = rand.nextInt(BOUND / MAXN + 1);
			hugeAlmostTwoSeq(d, d);
		}
		oneHugeSeq(10080 / 2);
		for (int i = 0; i < 2; i++) {
			oneHugeSeq(rand.nextInt(BOUND / 100 + 1));
		}
		for (int i = 1; i <= 10; i++) {
			highlyDivisibleDiff(i);
		}
		highlyDivisibleDiff(10080);
		highlyDivisibleDiff(20160);
		highlyDivisibleDiff(931170240);
		highlyDivisibleDiff(1745944200);
		for (int i = 0; i < 7; i++) {
			bigRandomTest();
		}
		for (int i = 0; i < 5; i++) {
			hugeRandomTest();
		}
		firstN(MAXN);
		lastN(MAXN);
		odd(MAXN);
		even(MAXN);
		finish();
	}

	private static void even(int n) throws IOException {
		next();
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = 0; i < n; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < 2 * n; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(i % 2 == 1 ? a[i / 2] : nextRandomBoundedInt());
		}
		out.println();
	}

	private static void odd(int n) throws IOException {
		next();
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = 0; i < n; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < 2 * n; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(i % 2 == 0 ? a[i / 2] : nextRandomBoundedInt());
		}
		out.println();
	}

	private static void lastN(int n) throws IOException {
		next();
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = n; i < a.length; i++) {
			a[i] = nextRandomBoundedInt();
		}
		for (int i = 0; i < n; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		for (int i = 0, j = n; i < n && j < a.length; i++, j++) {
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void firstN(int n) throws IOException {
		next();
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = n; i < a.length; i++) {
			a[i] = nextRandomBoundedInt();
		}
		for (int i = 0; i < n; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void oneHugeSeq(int d) throws IOException {
		next();
		int n = Math.min(MAXN, BOUND / (2 * d) + 1);
		int x = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (2 * n - 1) * d > BOUND) {
			x = -BOUND + rand.nextInt(BOUND - (2 * n - 1) * d + BOUND + 1);
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < 2 * n; i++) {
			a[i] = x + i * d;
		}
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void hugeAlmostTwoSeq(int d1, int d2) throws IOException {
		next();
		int n = Math.min(MAXN, 2 * BOUND / Math.max(d1, d2) + 1);
		int x1 = nextRandomBoundedInt();
		while (d1 < 0 || 1L * x1 + 1L * (n - 1) * d1 > BOUND) {
			x1 = nextRandomBoundedInt();
		}
		int x2 = nextRandomBoundedInt();
		while (d2 < 0 || 1L * x2 + 1L * (n - 1) * d2 > BOUND) {
			x2 = nextRandomBoundedInt();
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x1 + i * d1;
		}
		for (int i = n; i < 2 * n; i++) {
			a[i] = x2 + (i - n) * d2;
		}
		if (rand.nextBoolean()) {
			a[rand.nextInt(n)]++;
		} else {
			a[(n - 1) * rand.nextInt(2)]++;
		}
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void highlyDivisibleDiff(int d) throws IOException {
		next();
		HashSet<Integer> hs = new HashSet<Integer>();
		for (int i = 1; i * i <= d; i++) {
			if (d % i == 0) {
				hs.add(i);
				hs.add(d / i);
			}
		}
		int[] divs = new int[hs.size()];
		{
			int k = 0;
			for (int i : hs) {
				divs[k++] = i;
			}
		}
		int n = Math.min(MAXN, 2 * BOUND / d + 1);
		int x = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
		}
		// System.out.println(x + " " + d);
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = n; i < a.length; i++) {
			int div = divs[rand.nextInt(divs.length)];
			int mul = nextRandomBoundedInt();
			while (1L * mul * div + x < -BOUND || 1L * mul * div + x > BOUND) {
				mul = nextRandomBoundedInt();
			}
			a[i] = mul * div + x;
		}
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void hugeRandomTest() throws IOException {
		next();
		int n = MAXN;
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = n; i < a.length; i++) {
			a[i] = nextRandomBoundedInt();
		}
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	private static void bigRandomTest() throws IOException {
		next();
		int n = MAXN / 2 + rand.nextInt(MAXN / 2 + 1);
		int x = nextRandomBoundedInt();
		int d = nextRandomBoundedInt();
		while (d < 0 || 1L * x + 1L * (n - 1) * d > BOUND) {
			x = nextRandomBoundedInt();
			d = nextRandomBoundedInt();
		}
		int[] a = new int[2 * n];
		for (int i = 0; i < n; i++) {
			a[i] = x + i * d;
		}
		for (int i = n; i < a.length; i++) {
			a[i] = nextRandomBoundedInt();
		}
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		out.println(n);
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(a[i]);
		}
		out.println();
	}

	final static int MAXN = 100000;

	private static void hugeEqualTest() throws IOException {
		next();
		int x = nextRandomBoundedInt();
		out.println(MAXN);
		for (int i = 0; i < 2 * MAXN; i++) {
			if (i > 0) {
				out.print(" ");
			}
			out.print(x);
		}
		out.println();
	}

	static final int BOUND = (int) 1e9;

	private static void minEqualTest() throws IOException {
		next();
		int x = nextRandomBoundedInt();
		out.println("1");
		out.println(x + " " + x);
	}

	private static int nextRandomBoundedInt() {
		return -BOUND + rand.nextInt(2 * BOUND + 1);
	}

	private static void minTest() throws IOException {
		next();
		out.println("1");
		out.println("-1000000000 1000000000");
	}

	private static void sample() throws IOException {
		next();
		out.println("3");
		out.println("8 7 1 5 4 3");
	}

	private static void finish() {
		if (out != null) {
			out.close();
		}
	}

	private static void next() throws IOException {
		test++;
		finish();
		System.out.println("test " + (test / 10) + "" + (test % 10));
		out = new PrintWriter((test / 10) + "" + (test % 10));
	}

	static int test = 0;
	static PrintWriter out;
	static Random rand = new Random(135236532);
}
