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

public class FractionTestGen {

    static int done = 0;

    static final Random rand = new Random(556668949239L);

    static PrintWriter out;
    
    static final int maxr = 1000;

    static void printTest(int n, int k, int r)
            throws FileNotFoundException {
        done++;
        if (done < 10)
            out = new PrintWriter("../tests/0"+ String.valueOf(done));
        else
            out = new PrintWriter("../tests/" + String.valueOf(done));
        out.println(n + " " + k+" "+r);
        out.close();
    }
    
    static void printTest(int n, int k)
            throws FileNotFoundException {
        printTest(n, k, 1000);
    }
    
    


    void genEq() throws FileNotFoundException {
        for (int i = 1; i<=4; i++) {
            printTest(i, i);
        }
        printTest(100, 100);
        int n = rand.nextInt(10)+50;
        printTest(n, n);
    }
    
    void genSmall() throws FileNotFoundException {
        for (int i = 6; i<=10; i++) {
            printTest(i, 3+rand.nextInt(3));
        }
    }
    
    void genSmall10() throws FileNotFoundException {
        for (int i = 6; i<=10; i++) {
            printTest(i, 3+rand.nextInt(3), 10);
        }
    }
    
    void genSmall100() throws FileNotFoundException {
        for (int i = 6; i<=10; i++) {
            printTest(i, 3+rand.nextInt(3), 100);
        }
    }
    
    void genBetween(int l, int r) throws FileNotFoundException {
        // ans(r,l-1) = [], ans(r,l) != [] 
        printTest(r, l);
        printTest(r, (l+r)/2);
    }
    

    void gen(int l) throws FileNotFoundException {
        int x = 90+rand.nextInt(10);
        printTest(x, x-l);
    }

    public void run() throws IOException {
        new File("../tests").mkdir();
        printTest(10, 5, 60);
        genSmall10();
        genSmall100();
        genSmall();
        genEq();
        printTest(10, 1);
        printTest(100, 1);
        printTest(100, 50);
        genBetween(18,27);
        genBetween(54,64);
        genBetween(91,100);
        gen(31);
        gen(32);
        gen(65);
        for (int i = 1; i <= 10; i++) {
            gen(i);
        }
        for (int i = 1; i <= 15; i++) {
            printTest(100, 100 - i);
        }
    }

    public static void main(String[] args) throws IOException {
        new FractionTestGen().run();
    }
}