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

public class TestsGen implements Runnable {
	public static void main(String[] args) {
		if (args.length < 1) {
			for (I = 1; (new File(getName(I) + ".t")).exists(); I++)
				;
		} else {
			I = Integer.parseInt(args[0]);
		}
		new Thread(new TestsGen()).start();
	}

	PrintWriter out;

	Random rand = new Random(6439586L);

	static int I;

	static String getName(int i) {
		return ((i < 10) ? "0" : "") + i;
	}

	void open() {
		try {
			System.out.println("Generating test " + I);
			out = new PrintWriter(getName(I));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	void close() {
		out.close();
		I++;
	}
	
	final String ALPHA = "abcdefghijklmnopqrstuvwxyz";

	String randString(int len, String alpha) {
		StringBuilder ans = new StringBuilder();
		int k = alpha.length();
		for (int i = 0; i < len; i++) {
			ans.append(alpha.charAt(rand.nextInt(k)));
		}
		return ans.toString();
	}


	long rand(long l, long r) {
		return l + (rand.nextLong() >>> 1) % (r - l + 1);
	}

	int rand(int l, int r) {
		return l + rand.nextInt(r - l + 1);
	}
	
	void genTest(int n, int m, int k) {
		open();
		if (rand.nextBoolean()) {
			out.println(n + " " + m + " " + k);
		} else {
			out.println(n + " " + k + " " + m);
		}
		close();
	}
	
	final int MAX = 200;
	final int U = 7;
	
	public void solve() throws IOException {
		PrintWriter desc = new PrintWriter("tests.desc");
		desc.println("01-" + getName(I - 1) + ": tests from the statement");
		int pi = I;
		for (int i = 3; i < U; ++i) {
			for (int j = 3; j < U; ++j) {
				for (int k = 3; k <= j; ++k) {
					if (!(i == 3 && j == 3 && k == 3)) {
						genTest(i, j, k);
					}
				}
			}
		}
		desc.println(getName(pi) + "-" + getName(I - 1) + ": all combinations of 3 <= n, m, k <= 6");
		pi = I;
		for (int diff = 0; diff <= 4; ++diff) {
			for (int m = 3; m <= 5; ++m) {
				int n = rand(U, MAX);
				genTest(n, m, n + diff - m);
			}
			genTest(MAX, MAX / 2, MAX + diff - (MAX / 2));
			int m = rand(6, MAX);
			genTest(MAX, m, MAX + diff - m);
			desc.println(getName(pi) + "-" + getName(I - 1) + ": m + k - n = " + diff);
			pi = I;
		}
		
		for (int i = 0; i < 20; ++i) {
			genTest(rand(3, MAX), rand(3, MAX), rand(3, MAX));
		}
		desc.println(getName(pi) + "-" + getName(I - 1) + ": random");
		desc.close();
	}

	
	void myAssert(boolean e) {
		if (!e) {
			throw new Error("Assertion failed");
		}
	}

	public void run() {
		try {
			solve();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
}