//by Sergey Melnikov
package tests;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;

public class TestGen extends Thread {
	class Test {
		int n, m;

		public Test(int n, int m) {
			this.n = n;
			this.m = m;
		}

		public Test(int[] a) {
			this.n = a[0];
			this.m = a[1];
		}

	}

	private int testCount = 0;

	private void write(Test t) {
		try {
			++testCount;
			String filename = testCount / 10 + "" + testCount % 10;
			PrintWriter out = new PrintWriter(filename);
			System.err.println(testCount);
			out.println(t.n + " " + t.m);
			out.close();
		} catch (IOException ex) {
			throw new RuntimeException(ex);
		}
	}

	void myAssert(boolean b) {
		if (!b)
			throw new AssertionError();
	}

	static Random rand = new Random(1);
	final int MAXN = 2000;
	final int MAXM = 1000000000;
	final int[][] example = { { 2, 1000000 }, { 5, 1000000 } };

	@Override
	public void run() {
		for (int i = 0; i < example.length; i++) {
			write(new Test(example[i]));
		}
		for (int i = 2; i <= 10; i++) {
			write(new Test(i, MAXM));
			write(new Test(i, 2));
		}
		for (int i = 0; i < 10; i++) {
			write(new Test(MAXN - i, MAXM));
		}
		for (int i = 0; i < 20; i++) {
			write(new Test(rand.nextInt(MAXN - 1) + 2,
					rand.nextInt(MAXM - 1) + 2));
		}

	}

	public static void main(String[] args) {
		new TestGen().start();
	}
}
