/**
 * Created by GShark on 20.11.2014.
 */
import java.io.*;
import java.util.*;

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

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    int tNumber;
    Random rnd;
    final int MAXN = 100_000;
    final int MAXX = 1_000_000_000;
    ArrayList<Integer> test;

    int rand(int n) {
        return rnd.nextInt(n);
    }


    void print(ArrayList<Integer> al, int k) throws IOException {
        System.err.println(tNumber);
        if (tNumber < 10) {
            out = new PrintWriter("../tests/0" + tNumber);
        } else {
            out = new PrintWriter("../tests/" + tNumber);
        }
        tNumber++;
        out.println(al.size() + " " + k);
        for (int  i = 0; i < al.size() - 1; i++) {
            out.print(al.get(i) + " ");
        }
        out.println(al.get(al.size() - 1));
        al.clear();
        out.close();
    }

    // here starts gens

    void genSample1() throws IOException {
        test.add(1);
        test.add(2);
        test.add(3);
        print(test, 3);
    }

    void genSample2() throws IOException {
        test.add(1);
        test.add(2);
        test.add(2);
        test.add(1);
        print(test, 6);
    }

    void genSimple1() throws IOException {
        test.add(1);
        test.add(3);
        test.add(3);
        print(test, 1);
    }

    void genSimple2() throws IOException {
        test.add(1);
        test.add(1);
        test.add(3);
        test.add(3);
        print(test, 3);
    }

    void genRand(int n, int max, int k) throws IOException {
        for (int i = 0; i < n; i++)
            test.add(rand(max) + 1);
        print(test, k);
    }

    void genSpecial(int n, int k) throws IOException {
        for (int i = 0; i < n; i++)
            test.add(i + 1);
        print(test, k);
    }

    void genMAX1() throws IOException {
        for (int i = 0; i < MAXN; i++)
            test.add(rand(MAXX) + 1);
        print(test, MAXX);
    }

    void genMAX2() throws IOException {
        for (int i = 0; i < MAXN; i++)
            test.add(MAXX);
        print(test, MAXX);
    }



    //the end of the gens

    public void generate() throws IOException {
        new File("../tests").mkdir();
        tNumber = 1;
        rnd = new Random(388282447);
        test = new ArrayList<Integer>();

        genSample1();
        genSample2();
        genSimple1();
        genSimple2();
        genSpecial(10, 10);
        int x = MAXN / 2;
        for (int i = 0; i < 10; i++) {
            int n = rand(x);
            genRand(n, MAXX / (10 - i), rand(MAXX / 2) + MAXX / 2);
            n = rand(x);
            genRand(n + x, MAXX / (10 - i), rand(MAXX / 2) + MAXX / 2);
            n = rand(x);
            genRand(n + x, MAXX / (10 - i), MAXX);
        }
        genSpecial(MAXN, MAXX);
        genMAX1();
        genMAX2();
    }

    public void run() throws IOException {
        Locale.setDefault(Locale.US);
        generate();
    }
}
