import java.io.*;
import java.math.*;
import java.util.*;

public class TestGen {
    static final int MX = 30_000;

    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 print(int[] a) throws IOException {
        PrintWriter pw = new PrintWriter(String.format("../tests/%02d", ++testCount));
        System.out.println(testCount);
        pw.println(a.length);
        for (int i = 0; i < a.length; i++) {
            pw.print(a[i]);
            if (i + 1 < a.length) {
                pw.print(" ");
            } else {
                pw.println();
            }
        }
        pw.close();     
    }
    
    Random random = new Random(43534543);

    void genSample() throws IOException {
        int a[] = new int[3];
        a[0] = 1;
        a[1] = 1;
        a[2] = 1;
        print(a);
    }

    void genRandTest(int n, int m) throws IOException {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = random.nextInt(m * 2 + 1) - m;
        }
        print(a);
    }

    void genHardTests(int n) throws IOException {
        int a[] = new int[n];
        int b[] = new int[3];
        for (b[0] = -1; b[0] <= 1; b[0]++) {
            for (b[1] = -1; b[1] <= 1; b[1]++) {
                for (b[2] = -1; b[2] <= 1; b[2]++) {
                    for (int i = 0; i < n; i++) {
                        a[i] = MX * b[i % 3];
                    }
                    print(a);
                }
            }
        }
    }

    void run() throws IOException {
        new File("../tests").mkdir();
        
        genSample();    
        for (int i = 1; i <= 10; i++) {
            genRandTest(i, 50);
        }
        for (int i = 0; i < 5; i++) {
            genRandTest(MX, MX);
        }
        genHardTests(MX);
    }

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

}
