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

public class TestsGen {

    static PrintWriter out;
    static Random rnd = new Random(239017);
    static int tNumber = 1;
    static final int MAXN = 1_000_000_000;
    
    static void printTest(int a, int b) throws IOException {
        System.out.println(String.format("Generating test %d", tNumber));
        out = new PrintWriter(String.format("../tests/%02d", tNumber++));
        out.println(a + " " + b);
        out.close();
    }

    
    static void genSample() throws IOException {
        printTest(220, 440);
    }
    
    static int randFromTo(int l, int r) {
        return rnd.nextInt(r - l + 1) + l;      
    }

    static int make(long seed, int bound) {
        return make(seed, bound, MAXN);
    }
    
    static int make(long seed, int bound, int max) {
        int cur = randFromTo(2, bound);
        while (seed * cur <= max) {
            seed *= cur;
            cur = randFromTo(2, bound);
        }
        return (int)seed;
    }

    public static void main(String[] args) throws IOException {
        new File("../tests").mkdir();        
        genSample();
        printTest(1, 1);
        printTest(1, 2);
        for (int i = 0; i < 5; ++i) {
            int seed = randFromTo(1, 1000);
            int a = make(seed, 10, 10000);
            int b = make(seed, 10, 10000);
            printTest(a, b);
        }
        printTest(8888*3, 8888*6);
        for (int i = 0; i < 5; ++i) {
            int seed = randFromTo(100, 1000);
            int a = make(seed, (i+1)*10);
            int b = make(seed, (i+1)*10);
            printTest(a, b);
        }
        for (int i = 0; i < 5; ++i) {
            int a = randFromTo(100000, MAXN);
            int b = randFromTo(100000, MAXN);
            printTest(a, b);
        }
        
        for (int i = 0; i < 5; ++i) {
            int seed = randFromTo(100000, 1000000);
            int a = make(seed, 10);
            int b = make(seed, 10);
            printTest(a, b);
        }

        for (int i = 0; i < 5; ++i) {
            int seed = randFromTo(10000000, 100000000);
            int a = make(seed, 10);
            int b = make(seed, 10);
            printTest(a, b);
        }

        for (int i = 0; i < 5; ++i) {
            int a = randFromTo(MAXN/10, MAXN);
            int b = randFromTo(MAXN/10, MAXN);
            printTest(a, b);
        }
        printTest(MAXN, MAXN);
    }                 
}


