/**
 * Created by GShark on 10.11.2014.
 */
import java.io.*;
import java.util.*;

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

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    int tNumber;
    Random rnd;
    final long MAXN = 1_000_000_000_000_000_000l;
    ArrayList<Long> test;

    int rand(int n) {
        return rnd.nextInt(n);
    }

    long rand(long n) {
        long bits, val;
        do {
            bits = (rnd.nextLong() << 1) >>> 1;
            val = bits % n;
        } while (bits - val + (n - 1) < 0L);
        return val;
    }

    void print(ArrayList<Long> al) throws IOException {
        System.err.println(tNumber);
        if (tNumber < 10) {
            out = new PrintWriter("../tests/0" + tNumber);
        } else {
            out = new PrintWriter("../tests/" + tNumber);
        }
        tNumber++;
        out.println(al.get(0) + " " + al.get(1) + " " + al.get(2) + " " + al.get(3));
        al.clear();
        out.close();
    }

    // here starts gens

    void genSample1() throws IOException {
        test.add(1l);
        test.add(1l);
        test.add(1l);
        test.add(4l);
        print(test);
    }

    void genSample2() throws IOException {
        test.add(4l);
        test.add(3l);
        test.add(2l);
        test.add(1l);
        print(test);
    }

    void genSimple() throws IOException {
        test.add(0l);
        test.add(3l);
        test.add(0l);
        test.add(0l);
        print(test);
    }

    void genRand1(long maxn) throws IOException {
        long x = rand(maxn);
        long y = rand(maxn);
        long z = rand(maxn);
        long k = rand(maxn);
        test.add(x);
        test.add(y);
        test.add(z);
        test.add(k);
        print(test);
    }

    void genRand2(long maxn) throws IOException {
        long x = maxn / 2 + rand(maxn / 2);
        long y = maxn / 2 + rand(maxn / 2);
        long z = maxn / 2 + rand(maxn / 2);
        long k = maxn / 2 + rand(maxn / 2);
        test.add(x);
        test.add(y);
        test.add(z);
        test.add(k);
        print(test);
    }

    void genMax() throws IOException {
        long x = MAXN;
        long y = MAXN;
        long z = MAXN;
        long k = MAXN;
        test.add(x);
        test.add(y);
        test.add(z);
        test.add(k);
        print(test);
    }

    void genSp() throws IOException {
        long x = 0;
        long y = MAXN;
        long z = 0;
        long k = MAXN;
        test.add(x);
        test.add(y);
        test.add(z);
        test.add(k);
        print(test);
    }

    //the end of the gens

    public void generate() throws IOException {
        new File("../tests").mkdir();
        tNumber = 1;
        rnd = new Random(388282447);
        test = new ArrayList<Long>();
        genSample1();
        genSample2();
        genSimple();
        for (int i = 1; i <= 10; i++) {
            genRand1(i * 1000);
            genRand2(i * 1_000_000_000_000l);
        }
        genMax();
        genSp();
    }

    public void run() throws IOException {
        Locale.setDefault(Locale.US);
        generate();
    }
}
