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

public class TestGen {

	static Random rnd = new Random(4);
	static final int MAXN = 300000;
	static final int MAXK = 100000;

	static ArrayList<Long> primes = new ArrayList<Long>();
	static boolean[] isPrime = new boolean[MAXN];

	static class Test {
		long[] a;

		public Test(long[] a) {
			this.a = a.clone();
		}

		static int test = 1;

		void out() throws IOException {
			System.err.print(String.format("[%02d]", test));
			PrintWriter out = new PrintWriter(String.format("%02d", test++));

			out.println(a.length);
			for (int i = 0; i < a.length; i++) {
			  if (i > 0) {
			    out.print(" ");
			  }
				out.print(a[i]);
			}
			out.println();
			out.close();
		}

	}

	public static void shuffle(long[] a, int left, int right) {
		for (int i = left; i < right; i++) {
			long tmp = a[i];
			int tmp2 = left + rnd.nextInt(i - left + 1);
			a[i] = a[tmp2];
			a[tmp2] = tmp;
		}
	}

	public static void shuffle(long[] a, int k) {
		int stable = rnd.nextInt(k) + 1;

		int l = 0;
		int r = rnd.nextInt(a.length / stable);
		for (int i = 0; i < stable; i++) {
			shuffle(a, l, r);
			l = r;
			r += rnd.nextInt(a.length / stable);
		}
	}

	public static void main(String[] args) throws IOException {

		// new Test(new long[] { 1, 2, 3 }).out();
		// new Test(new long[] { 2, 1, 5, 9, 6 }).out();
		//
		int k = 0;
		for (int i = 0; i < 8; i++) {
			k += rnd.nextInt(113) + 50;
			long[] a = new long[k];
			a[0] = rnd.nextInt(10) + 1;
			for (int j = 1; j < k; j++) {
				a[j] = a[j - 1] + rnd.nextInt(125) + 1;
			}
			shuffle(a, rnd.nextInt(k / 5) + 1);
			new Test(a).out();
		}

		k = 150000;
		for (int i = 8; i < 19; i++) {
			k += rnd.nextInt(15000) + 1;
			long[] a = new long[k];
			a[0] = rnd.nextInt(666);
			for (int j = 1; j < k; j++) {
				a[j] = a[j - 1] + rnd.nextInt(2000) + 1;
			}
			shuffle(a, rnd.nextInt(k / 10) + 1);
			new Test(a).out();
		}

		k = 300000;
		long[] a = new long[k];
		a[0] = rnd.nextInt(10000);
		for (int j = 1; j < k; j++) {
			a[j] = a[j - 1] + rnd.nextInt(6500) +1;
		}
		shuffle(a, rnd.nextInt(k / 10) + 1);
		new Test(a).out();
	}
}
