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

public class doall {
	static TestWriter t = new TestWriter();
	static Random r = new Random(566);

	private static void t(int[] a) {
		int[] b = new int[a.length + 1];
		b[0] = a.length;
		System.arraycopy(a, 0, b, 1, a.length);
		t.t(b);
	}
	
	private static void s(int[] a) {
		a = a.clone();
		shuffle(a);
		int[] b = new int[a.length + 1];
		b[0] = a.length;
		System.arraycopy(a, 0, b, 1, a.length);
		t.t(b);
	}
	
	public static void shuffle(int[] a) {
		for (int i = a.length - 1; i > 0; i--) {
			int j = r.nextInt(i + 1);
			int t = a[i]; a[i] = a[j]; a[j] = t;
		}
	}

	static private void tournament(int n, double better, double draw) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (r.nextDouble() < draw) {
					a[i]++;
					a[j]++;
					continue;
				}
				if (r.nextDouble() < better)
					a[i] += 3;
				else
					a[j] += 3;
			}
		}
		shuffle(a);
		t(a);
	}
	
	public static void main(String[] args) {
		t(new int[]{3, 3, 3});
		t(new int[]{0, 3});
		t(new int[]{1, 1});
		t(new int[]{3, 0});
		t(new int[]{2, 2, 2});
		t(new int[]{4, 1, 2});
		t(new int[]{6, 1, 1});
		t(new int[]{4, 0, 4});
		t(new int[]{4, 1, 3});
		t(new int[]{0, 3, 6});
		t(new int[]{3, 3, 3, 3});
		t(new int[]{4, 4, 4, 4});
		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 4; j++)
				tournament(4 + r.nextInt(2), i / 6d, j / 4d);
		tournament(5, 0, 0);
		tournament(5, 0.25, 0);
		tournament(5, 0.5, 0);
		tournament(5, 0.5, 0.7);
		tournament(5, 0, 0.9);
		tournament(5, 0.5, 0.9);
		tournament(5, 0.1, 0.5);
		tournament(5, 0.4, 0.5);
		tournament(5, 0.5, 0.5);
		tournament(5, 0.5, 0.4);
		tournament(5, 0.5, 1/3d);
		int[] a = new int[]{3, 4, 5, 6, 7};
		s(a);
		for (int i = 3; i >= 1; i--) {
			a[i]++;
			s(a);
		}
		Arrays.fill(a, 5);
		for (int i = 0; i < 3; i++) {
			s(a);
			a[i] = 6;
		}
		Arrays.fill(a, 6);
		t(a);
		Arrays.fill(a, 5);
		a[0] = 4;
		for (int i = 1; i < 4; i++) {
			s(a);
			a[i] = 6;
		}
		a = new int[]{3, 4, 5, 6, 7};
		for (a[0] = 1; a[0] <= 4; a[0]++)
			s(a);
	}
}

class TestWriter {
	public int curTest = 1;
	public PrintWriter out;

	public void open() {
		try {
			out = new PrintWriter("" + curTest / 10 + curTest % 10);
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public void close() {
		out.close();
		curTest++;
	}

	public void t(String s) {
		open();
		out.println(s);
		close();
	}

	public void t(String[] s) {
		open();
		for (String ss : s)
			out.println(ss);
		close();
	}

	public void tn(String[] s) {
		open();
		out.println(s.length);
		for (String ss : s)
			out.println(ss);
		close();
	}

	public void t(Object[] s) {
		open();
		for (Object ss : s)
			out.println(ss);
		close();
	}

	public void tn(Object[] s) {
		open();
		out.println(s.length);
		for (Object ss : s)
			out.println(ss);
		close();
	}

	public void t(int s) {
		open();
		out.println(s);
		close();
	}

	public void tl(int s1, int s2) {
		open();
		out.println(s1 + " " + s2);
		close();
	}

	public void t(int[] s) {
		open();
		for (int ss : s)
			out.println(ss);
		close();
	}

	public void tn(int[] s) {
		open();
		out.println(s.length);
		for (int ss : s)
			out.println(ss);
		close();
	}
}
