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

public class Tests {
	private static File dir = new File("../tests");
	private int curTest = 1;
	private static boolean verbose = true;

	private String testName;
	private PrintWriter out;
	private Random r = new Random(20943850943275L);
	
	public static final int MAX = 50;

	public void run() {
		t(8, 8, 8, 2);
		t(4, 4, 8, 8);
		for (int i = 0; i < 36; i++) {
			int[] ac = type(i / 6);
			int[] bd = type(i % 6);
			t(ac[0], bd[0], ac[1], bd[1]);
		}
		t(MAX, MAX, MAX - 1, MAX);
		t(MAX, MAX, MAX, MAX - 1);
	}

	private int[] type(int type) {
		int signumDesired = type % 3 - 1;
		boolean has1Desired = type / 3 > 0;
		int[] result = new int[2];
		for (;;) {
			result[0] = 1 + r.nextInt(MAX);
			result[1] = 1 + r.nextInt(MAX);
			int signum = Integer.compare(result[0], result[1]);
			boolean has1 = Math.min(result[0], result[1]) == 1;
			if (signum == signumDesired && has1 == has1Desired) {
				break;
			}
		}
		return result;
	}

	private void t(int a, int b, int c, int d) {
		open();
		out.println(a + " " + b + " " + c + " " + d);
		close();
	}

	private void open() {
		try {
			testName = "" + curTest / 10 + curTest % 10;
			out = new PrintWriter(new File(dir, testName));
			if (verbose) { 
				System.out.print("Generating " + testName + "...");
			}
		} catch (IOException e) {
			throw new RuntimeException("Unable to open " + testName + " for writing", e);
		}
	}

	private void close() {
		out.close();
		if (verbose) {
			System.out.println(" done.");
		}
		curTest++;
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		dir.mkdirs();
		new Tests().run();
	}
}
