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

public class StressGen {

	PrintWriter out;
	BufferedReader br;
	StringTokenizer st;

	String nextToken() throws IOException {
		while ((st == null) || (!st.hasMoreTokens()))
			st = new StringTokenizer(br.readLine());
		return st.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());
	}

	public void solve() throws IOException {
		Random rnd = new Random();
		int n = 5 + rnd.nextInt(10);
		ArrayList<Integer> a = new ArrayList<Integer>();
		
		for (int i = 0; i < n; i++)
			a.add(i, i + 1);
		Collections.shuffle(a, rnd);
		out.println(n);
		for (int x : a) {
			out.print(x + " ");
		}
		out.println();
		int k = rnd.nextInt(n - 1) + 1;
		out.println(k);
		Collections.shuffle(a, rnd);
		for (int i = 0; i < k; i++) {
			out.print(a.get(i) + " ");
		}
		out.println();
		for (int i = k; i < n; i++) {
			out.print(a.get(i) + " ");
		}
		out.println();
	}

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

			//br = new BufferedReader(new FileReader("StressGen.in"));
			out = new PrintWriter("dragons.in");

			solve();

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

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