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 = 300000;
	ArrayList<Integer> test;

	public void generate() throws IOException {
		new File("../tests").mkdir();
		tNumber = 1;
		rnd = new Random(31311331);
		genSimple();
		genSmall();
		genRand(10, 100);
		genRand(10, 100);
		genRand(10, 100);
		for (int i = 0; i < 3; i++) 
			genRand(1000, 10000);
		genMax1(MAXN);
		genMax2(MAXN);
		genMax3(MAXN);
		genMax4(MAXN);
		genRand(MAXN, 1000000000);
		genRand(MAXN - 1, 1000000000);
	}

	void print(ArrayList<Integer> al, int r) 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() + " " + r);
		Collections.sort(al);
		for (Integer x : al) {
			out.print(x);
			if (x != al.get(al.size() - 1))
				out.print(" ");
		}
		out.println();
		out.close();
	}

	String genRandomString(int len, String alph) {
		char[] a = new char[len];
		for (int i = 0; i < len; i++) {
			a[i] = alph.charAt(rnd.nextInt(alph.length()));
		}
		return new String(a);
	}

	void genSimple() throws IOException {
		ArrayList<Integer> al = new ArrayList<>();
		al.add(1);
		al.add(5);
		al.add(3);
		al.add(8);
		print(al, 4);
	}

	void genSmall() throws IOException {
		ArrayList<Integer> al = new ArrayList<>();
		al.add(5);
		al.add(1);
		print(al, 4);
		print(al, 3);
		al.add(2);
		print(al, 1);
		print(al, 1000000000);
		al.add(7);
		al.add(13);
		print(al, 2);
	}

	
	void genRand(int n, int maxx) throws IOException {
		ArrayList<Integer> al = new ArrayList<Integer>();
		HashSet<Integer> set = new HashSet<Integer>();
		for (int i = 0; i < n; i++) {
			int x = rnd.nextInt(maxx) + 1;
			while (set.contains(x)) {
				x = rnd.nextInt(maxx) + 1;
			}
			set.add(x);
			al.add(x);
		}
		for (int i = 0; i < 5; i++) {
			print(al, rnd.nextInt(maxx) + 1);
		}
	}
	void genMax1(int n) throws IOException {
		ArrayList<Integer> al = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			al.add(i + 1);	
		}
		print(al, n - 1);
	}
	void genMax2(int n) throws IOException {
		ArrayList<Integer> al = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			al.add(i + 1);	
		}
		print(al, n - 2);
	}
	void genMax3(int n) throws IOException {
		ArrayList<Integer> al = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			al.add(2 * i + 1);	
		}
		print(al, n - 1);
	}
	void genMax4(int n) throws IOException {
		ArrayList<Integer> al = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			al.add(3000 * i + 1);	
		}
		print(al, 2999);
	}





	static int max;
	static int[] positions;
	static ArrayList<Integer> pivots;

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

}