import java.io.*;
import java.math.BigInteger;
import java.util.Random;
import java.util.Arrays;

public class TestsGen {

    int testCount;

    void write(String s) throws IOException {
        PrintWriter pw = new PrintWriter(String.format("../tests/%02d", ++testCount));
        System.out.println(testCount);
        pw.println(s);
        pw.close();
    }

    void write(int n) throws IOException {
        write(Integer.toString(n));
    }

    Random random = new Random(43534543);
    int MAXLEN = 10000;

    int[] prelim = new int[]{22, 200, 1000, 239};

    void genPreliminary() throws IOException {
        for (int i = 0; i < prelim.length; i++) {
            PrintWriter out = new PrintWriter(String.format("../preliminary/%02d", i + 1));
            out.println(prelim[i]);
            out.close();
        }
    }

    void writeArr(int[] a) throws IOException {
        StringBuilder sb = new StringBuilder();
        sb.append(a.length);
        sb.append("\r\n");
        for (int i = 0; i < a.length; i++) {
            sb.append(a[i]);
            if (i < a.length - 1) sb.append(" ");
        }
        write(sb.toString());
    }

    void writeRand(int len) throws IOException {
        int[] a = new int[len];
		int last = 0;
		int MX = random.nextInt((int)1e8) + (int)9e8;
        for (int i = 0; i < len; i++) {
			a[i] = random.nextInt(MX - 10 - (len - i) - last) + 1 + last;
			last = a[i];
		}
        Arrays.sort(a);
        writeArr(a);
    }

    void writeMax(int len) throws IOException {
        int[] a = new int[len];

        for (int i = 0; i < len; i++) {
            a[i] = (int)1e9;
        }

        writeArr(a);
    }

    void run() throws IOException {
        new File("../tests").mkdir();

        writeArr(new int[] {1, 2, 3, 4, 5});
        writeArr(new int[] {100});
        writeArr(new int[] {1, 2, 3, 4, 6});
        writeArr(new int[] {2, 5, 10, 12});

        writeRand(10);
        writeRand(10);
        writeRand(10);

        writeRand(100);
        writeRand(100);

		for (int it = 0; it < 20; it++) {
	        writeRand(100000);
		}
    }

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

}
