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

public class Gen {

	static int done = 0;

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

	static final long MAX_SUM1 = 4 * (long) (1e+5);
	static final long MAX_SUM2 = 4 * (long) (1e+18);

	static ArrayList<String> data = new ArrayList<>();

	static void print(long a, long b, long c, long d) throws IOException {
		done++;
		System.err.println(a + " " + b + " " + c + " " + d);
		PrintWriter out;
		if (done < 10)
			out = new PrintWriter("../tests/0" + String.valueOf(done));
		else
			out = new PrintWriter("../tests/" + String.valueOf(done));
		out.println(a + " " + b + " " + c + " " + d);
		out.close();
	}

	static void genSimple() throws IOException {
		PrintWriter out;
		out = new PrintWriter("../preliminary/01");
		out.println("2 2 2 2");
		out.close();
		out = new PrintWriter("../preliminary/02");
		out.println("10 10 0 0");
		out.close();

	}

	static long genNumber(long minValue, long maxValue) {
		return (rand.nextLong() % (maxValue - minValue + 1) + maxValue
				- minValue + 1)
				% (maxValue - minValue + 1) + minValue;
	}

	public static void main(String[] args) throws IOException {
		boolean f = (new File("../preliminary")).mkdir();
		f = new File("../tests").mkdir();

		genSimple();

		done = 0;
		print(0, 10, 0, 10);
		print(8, 5, 7, 8);

		print(genNumber(10,20),genNumber(400,500),genNumber(400,500),genNumber(400,500));
      	print(genNumber(400,500),genNumber(10,20),genNumber(400,500),genNumber(400,500));
		print(genNumber(400,500),genNumber(400,500),genNumber(10,20),genNumber(400,500));
		print(genNumber(400,500),genNumber(400,500),genNumber(400,500),genNumber(10,20));

		print(genNumber(1000,2000),genNumber(80000,100000),genNumber(80000,100000),genNumber(80000,100000));
		print(genNumber(80000,100000),genNumber(1000,2000),genNumber(80000,100000),genNumber(80000,100000));
		print(genNumber(80000,100000),genNumber(80000,100000),genNumber(1000,2000),genNumber(80000,100000));
		print(genNumber(80000,100000),genNumber(80000,100000),genNumber(80000,100000),genNumber(1000,2000));

		print(0,(long)(1e+9),0,(long)(1e+9));

		long max = (long)(1e+8);

		print(genNumber(1000000,2000000),genNumber(8*max,10*max),genNumber(8*max,10*max),genNumber(8*max,10*max));
		print(genNumber(8*max,10*max),genNumber(1000000,2000000),genNumber(8*max,10*max),genNumber(8*max,10*max));
		print(genNumber(8*max,10*max),genNumber(8*max,10*max),genNumber(1000000,2000000),genNumber(8*max,10*max));
		print(genNumber(8*max,10*max),genNumber(8*max,10*max),genNumber(8*max,10*max),genNumber(1000000,2000000));
		print(genNumber(8*max,10*max),genNumber(1000000,2000000),genNumber(8*max,10*max),genNumber(8*max,10*max));
		print(genNumber(8*max,10*max),genNumber(8*max,10*max),genNumber(1000000,2000000),genNumber(8*max,10*max));


		max = (long)(1e+18);
		print(max, max, max, max);
		print(max/2, max/2, max/2 - 1, max/2);
		long x = genNumber((long)(1e+8), (long)(1e+9));
		x = x * x;
		print(x / 2 - 1, x / 2, x / 2, x / 2);
	    
 		return;
	}
}
