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++;
	}
	
	void genRandTest() {
		open();
		out.println((1 + rand.nextInt(1000)) + " " + (1 + rand.nextInt(1000)));
		close();
	}
	
	void genMaxTest() {
		open();
		out.println("1000 1000");
		close();
	}
	
	void genMinTest() {
		open();
		out.println("1 1");
		close();
	}
	
	public void solve() throws IOException {
		for (int i = 0; i < 22; i++) {
			genRandTest();
		}
		genMinTest();
		genMaxTest();
	}

	void myAssert(boolean e, String msg) {
		if (!e) {
			throw new Error(msg);
		}
	}

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