import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;

public class fitness_gen {
	public static void main(String[] args) throws IOException {
		int testn = 50;
		Random rand = new Random(255666);
		for (int test = 0; test < testn; test++) {
			PrintWriter out = new PrintWriter((test + 1 < 10 ? "0" : "")
					+ (test + 1));
			switch (test) {
			case 0:
				out.println("2 4");
				out.println("1 2");
				out.println("1 1");
				break;
			case 1:
				out.println("1 1");
				out.println("1 0");
				break;
			case 2:
				out.println("1 1");
				out.println("0 1");
				break;
			case 3:
				out.println("1 1");
				out.println("0 0");
				break;
			case 4:
				out.println("2 1000");
				out.println("1000 0");
				out.println("0 1000");
				break;
			case 5:
				out.println("2 1000");
				out.println("0 1000");
				out.println("1000 0");
				break;
			case 6:
				out.println("2 1000");
				out.println("1000 0");
				out.println("0 500");
				break;
			case 7:
				out.println("2 1000");
				out.println("0 1000");
				out.println("500 0");
				break;
			case 8:
				out.println("2 1000");
				out.println("0 500");
				out.println("1000 0");
				break;
			case 9:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					out.println(i + " " + i);
				}
				break;
			case 10:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					out.println((1000 - i) + " " + i);
				}
				break;
			case 11:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					out.println(i + " " + (1000 - i));
				}
				break;
			case 12:
				out.println("100 100");
				for (int i = 0; i < 100; i++) {
					out.println(i + " " + (100 - i));
				}
				break;
			case 13:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					if (i % 2 == 0) {
						out.println("1000 0");
					} else {
						out.println("0 1000");
					}
				}
				break;
			case 14:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					if (i % 2 != 0) {
						out.println("1000 0");
					} else {
						out.println("0 1000");
					}
				}
				break;
			case 15:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					if (i % 2 != 0) {
						out.println("1 0");
					} else {
						out.println("0 1");
					}
				}
				break;
			case 16:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					out.println("0 0");
				}
				break;
			case 17:
				out.println("100 1000");
				for (int i = 0; i < 100; i++) {
					out.println("500 500");
				}
				break;
			case 18:
				out.println("100 1");
				for (int i = 0; i < 100; i++) {
					out.println("0 0");
				}
				break;
			case 19:
				out.println("100 1");
				for (int i = 0; i < 100; i++) {
					out.println("1 0");
				}
				break;
			case 20:
				out.println("100 1");
				for (int i = 0; i < 100; i++) {
					out.println("0 1");
				}
				break;
			case 21:
				out.println("100 1");
				for (int i = 0; i < 100; i++) {
					if (i % 2 == 0) {
						out.println("1 0");
					} else {
						out.println("0 1");
					}
				}
				break;

			default:
				int n = rand.nextInt(100) + 1;
				int k = rand.nextInt(1000) + 1;
				int[] a = new int[n];
				int[] b = new int[n];
				for (int i = 0; i < a.length; i++) {
					a[i] = rand.nextInt(k + 1);
				}
				for (int i = 0; i < b.length; i++) {
					b[i] = rand.nextInt(k + 1 - a[i]);
				}
				out.println(n + " " + k);
				for (int i = 0; i < b.length; i++) {
					out.println(a[i] + " " + b[i]);
				}
				break;
			}
			out.close();
		}
	}
}
