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

public class TestsGen {
	static int testcount = 0;

	static Random random = new Random(89763456);
	
	static int MAX = 100000;

	static void write(int n, long k) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		out.println(n + " " + k);
		out.close();
	}
	
	static long max(long n) {
		return n * (n - 1) / 2;
	}
	
	static long rand(long n) {
		return Math.abs(random.nextLong()) % (n * (n - 1) / 2);
	}

	public static void main(String[] args) throws IOException {
		while (new File(String.format("%02d.t", testcount + 1)).exists()) {
			testcount++;
		}
		write(1, 0);
		write(10, 0);
		write(10, max(10));
		write(10, rand(10));
		write(6, rand(6));
		write(7, rand(7));
		
		write(1000, 0);
		write(1000, max(1000));
		write(20, rand(20));
		write(100, rand(100));
		write(500, rand(500));
		write(1000, rand(1000));
		
		write(MAX, 0);
		write(MAX, max(MAX));
		for (int i = 0; i < 3; i++) {
			write(MAX, rand(MAX));
			int t = random.nextInt(MAX - MAX / 10) + MAX / 10;
			write(t, rand(t));
		}
	}

}
