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

public class contestGen {

	void solve() throws IOException {
		Random rnd = new Random();
		int n = 1 + rnd.nextInt(3);
		int m = 1 + rnd.nextInt(3);
		int t = 1 + rnd.nextInt(10);
		int l = 1 + rnd.nextInt(t);
		out.println(n + " " + m + " " + l + " " + t);
		for (int i = 0; i < n; i++) {
			HashSet<Integer> good = new HashSet<Integer>();
			int k = rnd.nextInt(m + 1);
			while (good.size() != k) {
				good.add(1 + rnd.nextInt(m));
			}
			out.print(k);
			for (int x : good) {
				out.print(" " + x);
			}
			out.println();
		}
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

	void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			// br = new BufferedReader(new FileReader(new
			// File("contestGen.in")));
			out = new PrintWriter("contest.in");
			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

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

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

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

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

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