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

public class TestsGen {
	static int testcount = 0;

	static Random random = new Random(97543);
	
	static int MAXN = 20;
	static int MAX = 100;
	
	static void write(int k, int[] a, int[] b, int[] c) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		out.println(a.length + " " + k);
		for (int i = 0; i < a.length; i++) {
			out.println(a[i] + " " + b[i] + " " + c[i]);
		}
		out.close();
	}
	
	static void writeRand(int n, int max) throws IOException {
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = random.nextInt(2 * max + 1) - max;
			b[i] = random.nextInt(2 * max + 1) - max;
			if (b[i] < a[i]) {
				int t = a[i]; a[i] = b[i]; b[i] = t;
			}
			c[i] = random.nextInt(2 * max + 1) - max;
		}
		int k = random.nextInt(2 * max + 1) - max;
		write(k, a, b, c);
	}
	
	public static void main(String[] args) throws IOException {
		while (new File(String.format("%02d.t", testcount + 1)).exists()) {
			testcount++;
		}
		writeRand(2, 10);
		writeRand(3, 20);
		for (int i = 4; i <= MAXN; i++) {
			writeRand(i, MAX);
		}
		writeRand(MAXN, MAX);
		writeRand(MAXN, MAX);
		writeRand(MAXN, MAX);
	}

}