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




public class TestGen {

    static PrintWriter out;
    static Random rnd = new Random(0);
    static int tNumber;
    
    static void printTest(int sum, int n) throws IOException {
        if (tNumber < 10)
            out = new PrintWriter("../tests/0" + tNumber);
        else
            out = new PrintWriter("../tests/" + tNumber);
        tNumber++;
        out.println(sum + " " + n);
        out.close();        
    }
    
    static void genSample() throws FileNotFoundException {
        out = new PrintWriter("../tests/01");               
        out.println(8 + " " + 1);
		out.close();                
		out = new PrintWriter("../tests/02");               
        out.println(14 + " " + 2);
	    out.close();                
    }
    
    static int randFromTo(int l, int r) {
        return rnd.nextInt(r - l + 1) + l;      
    }

        
    public static void main(String[] args) throws IOException {
        genSample();
        tNumber = 3;              
    	printTest(1, 1);
		printTest(1, 10);
		for (int i = 0; i < 5; i++) {
			int n = randFromTo(1, 100);
			int sum = randFromTo(1, n * 9);
			printTest(sum, n);
		}
		printTest(100, 10);
		for (int i = 0; i < 5; i++) {
			int n = randFromTo(1, 100000);
			int sum = randFromTo(1, n * 9);
			printTest(sum, n);
		}
		printTest(10000, 1000);
		
		for (int i = 0; i < 5; i++) {
			int n = randFromTo(10000, 100000);
			int sum = randFromTo(1, n * 9);
			printTest(sum, n);
		}
		printTest(100000, 10000);
		printTest(1000000, 100000);    
    }
}
