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

public class doall implements Runnable {
	PrintWriter out;
	Random rnd = new Random(566);
	final int MAXCOORD = 10000;
	int test = 0;
	
	private int random(int lo, int hi) {
		return lo + rnd.nextInt(hi - lo + 1);
	}
	
	private int random(int hi) {
		return random(-hi, hi);
	}
	
	private void open() {
		test++;
		try {
			out = new PrintWriter(test / 10 + "" + test % 10);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	private void print(int a, int b) {
		out.println(a + " " + b);
	}
	
	private void print(double a, double b) {
		print((int) a, (int) b);
	}

	private void close() {
		out.close();
	}
	
	private void regular(int n, int m, int r) {
		open();
		print(n, m);
		int x = random(MAXCOORD - r);
		int y = random(MAXCOORD - r);
		double phi = rnd.nextDouble() * 2 * Math.PI;
		for (int i = 0; i < n; i++) {
			double alpha = phi + 2 * Math.PI * i / n;
			print(x + r * Math.cos(alpha), y + r * Math.sin(alpha));
		}
		close();
	}

	private void spiral(int n, double a0, double a1, double r0, double r1) {
		for (int i = 0; i <= n; i++) {
			double alpha = a0 + i * (a1 - a0) / n;
			double rad = r0 + i * (r1 - r0) / n;
			print(rad * Math.cos(alpha), rad * Math.sin(alpha));
		}
	}

	private void binaryTree(int x, int y, int wid) {
		print(x, y);
		if (wid == 1)
			return;
		binaryTree(x - wid, y - 8, wid / 2);
		print(x, y);
		binaryTree(x + wid, y - 8, wid / 2);
		if (y < 0)
			print(x, y);
	}

	private void line(double x1, double y1, double x2, double y2, int n) {
		for (int i = 0; i < n; i++) {
			double x = x1 + (x2 - x1) * i / n;
			double y = y1 + (y2 - y1) * i / n;
			print(x, y);
		}
	}

	private void peano(int n, int x, int y, int dx, int dy, int dx2, int dy2) {
		if (n == 1) {
			print(x, y);
			return;
		}
		n /= 2;
		peano(n, x, y, dx2, dy2, dx, dy);
		peano(n, x + dx2 * n, y + dy2 * n, dx, dy, dx2, dy2);
		peano(n, x + dx2 * n + dx * n, y + dy2 * n + dy * n, dx, dy, dx2, dy2);
		peano(n, x + dx * (2 * n - 1) + dx2 * (n - 1), y + dy * (2 * n - 1) + dy2 * (n - 1), -dx2, -dy2, -dx, -dy);
	}

	public void run() {
		open();
		print(4, 2);
		print(0, 0);
		print(0, 1);
		print(1, 1);
		print(1, 0);
		close();
		
		regular(3, 8, 2);
		
		regular(11, 9, 10);
		
		open();
		print(4, 2);
		print(-MAXCOORD, MAXCOORD);
		print(MAXCOORD, -MAXCOORD);
		print(-MAXCOORD, -MAXCOORD);
		print(MAXCOORD, MAXCOORD);
		close();

		open();
		print(16, 2);
		for (int i = 0; i < 16; i++) {
			double alpha = 2 * Math.PI * i / 16;
			double x = Math.cos(alpha);
			double y = Math.sin(alpha);
			print(40 * x - 5 * y, 40 * x + 5 * y);
		}
		close();

		open();
		print(40, 7);
		for (int i = 0; i < 40; i++) {
			double alpha = 2 * Math.PI * i / 40;
			double r = 20 + 10 * Math.cos(i);
			double x = r * Math.cos(alpha);
			double y = r * Math.sin(alpha);
			print(x, y);
		}
		close();
		
		open();
		print(64, 81);
		for (int x = 1; x < 30; x += 2) {
			print(x, 15);
			print(x, 1);
			print(x + 1, 1);
			print(x + 1, 15);
		}
		print(31, 15);
		print(31, 0);
		print(0, 0);
		print(0, 15);
		close();
		
		open();
		print(60, 9);
		for (int i = 0; i < 60; i++) {
			double x = 5 * Math.cos(i);
			double y = 30 * Math.sin(2 * Math.PI * i / 60);
			print(x, y);
		}
		close();
		
		open();
		print(100, 3);
		for (int i = 0; i < 50; i++) {
			print(-MAXCOORD, MAXCOORD);
			print(MAXCOORD, -MAXCOORD);
		}
		close();
		
		open();
		print(97, 12);
		for (int i = 0; i < 97; i++) {
			double alpha = 2 * Math.PI * (12 * i) / 97;
			double x = MAXCOORD * Math.cos(alpha);
			double y = MAXCOORD * Math.sin(alpha);
			print(x, y);
		}
		close();
		
		open();
		print(142, 44);
		spiral(70, 0, 14 * Math.PI, 3, 50);
		spiral(70, 14 * Math.PI, 0, 49, 2);
		close();
		
		open();
		print(288, 5);
		for (int i = 0; i < 144; i++) {
			double x = i;
			double y = 72 + 72 * Math.cos(2 * Math.PI * i / 18);
			print(x, y);
		}
		for (int i = 143; i >= 0; i--) {
			double y = i;
			double x = 72 + 72 * Math.cos(2 * Math.PI * i / 18);
			print(x, y);
		}
		close();
		
		open();
		print(252, 2);
		binaryTree(0, 0, 64);
		close();
		
		open();
		print(500, 1000);
		for (int i = 0; i < 500; i++)
			print(random(MAXCOORD), random(MAXCOORD));
		close();
		
		open();
		print(666, 4);
		for (int i = 0; i < 222; i++) {
			print(-MAXCOORD, -MAXCOORD);
			print(MAXCOORD, -MAXCOORD);
			print(-MAXCOORD, MAXCOORD);
		}
		close();
		
		open();
		print(700, 6);
		for (int i = 0; i < 700; i++) {
			double alpha = 2 * Math.PI * i / 100;
			double r = 200 + 70 * Math.cos(2 * Math.PI * i / 7);
			print(r * Math.cos(alpha), r * Math.sin(alpha));
		}
		close();
		
		open();
		print(1200, 239);
		for (int i = 0; i < 300; i++) {
			double r1 = 400 + 100 * Math.cos(i);
			double r2 = 400 + 100 * Math.cos(i + 1);
			double alpha = 2 * Math.PI * i / 100;
			print(r1 * Math.cos(alpha), r1 * Math.sin(alpha));
			print(280 * Math.cos(alpha), 280 * Math.sin(alpha));
			print(520 * Math.cos(alpha), 520 * Math.sin(alpha));
			print(r2 * Math.cos(alpha), r2 * Math.sin(alpha));
		}
		close();
		
		open();
		print(2400, 44);
		for (int i = 0; i < 2400; i++) {
			double alpha = 2 * Math.PI * i / 1200;
			double r = 400 + 100 * Math.cos(i / 60);
			print(r * Math.cos(alpha), r * Math.sin(alpha));
		}
		close();
		
		open();
		print(2400, 20);
		for (int i = 0; i < 2400; i++) {
			double alpha = 2 * Math.PI * i / 1200;
			double r = 400 + 100 * Math.cos(2 * Math.PI * i / 60);
			if (i < 1200)
				r += 40 * Math.cos(2 * Math.PI * i / 20);
			print(r * Math.cos(alpha), r * Math.sin(alpha));
		}
		close();
		
		open();
		print(8000, 10000);
		for (int i = 0; i < 8; i++)
			spiral(999, rnd.nextDouble(), 1000 * rnd.nextDouble(), MAXCOORD * rnd.nextDouble(), MAXCOORD * rnd.nextDouble());
		close();
		
		regular(20000, 7777, MAXCOORD);
		
		open();
		print(80000, 2);
		line(-MAXCOORD, -MAXCOORD, MAXCOORD, -MAXCOORD, 20000);
		line(MAXCOORD, -MAXCOORD, MAXCOORD, MAXCOORD, 20000);
		line(MAXCOORD, MAXCOORD, -MAXCOORD, MAXCOORD, 20000);
		line(-MAXCOORD, MAXCOORD, -MAXCOORD, -MAXCOORD, 20000);
		close();
		
		open();
		print(100000, 100000);
		for (int i = 0; i < 100000; i++) {
			print((i % 2 == 0) ? -MAXCOORD : MAXCOORD, random(MAXCOORD));
		}
		close();
		
		open();
		print(100000, 100000);
		for (int i = 0; i < 100000; i++) {
			double alpha = Math.PI * rnd.nextDouble();
			double r = random(MAXCOORD - 100, MAXCOORD);
			print(r * Math.cos(alpha), r * Math.sin(alpha));
		}
		close();
		
		open();
		print(100000, 77777);
		double cur = rnd.nextDouble();
		for (int i = 0; i < 100000; i++) {
			double x = Math.cos(cur);
			double y = Math.sin(cur);
			double coef = MAXCOORD / Math.max(Math.abs(x), Math.abs(y));
			print(x * coef, y * coef);
			cur += rnd.nextDouble() + 0.01;
		}
		close();
		
		open();
		print(2 * 128 * 128, 5);
		peano(128, 0, 0, 1, 0, 0, 1);
		peano(128, 127, -1, -1, 0, 0, -1);
		close();
		
		open();
		print(3 * 128 * 128, 2);
		peano(128, 0, 0, 1, 0, 0, 1);
		peano(128, 127, -1, -1, -1, 1, -1); 
		peano(128, -1, -127, 0, 1, -1, 0);
		close();
		
		open();
		print(2 * MAXCOORD + 3, 2);
		print(-100, MAXCOORD);
		print(-100, -MAXCOORD);
		for (int i = -MAXCOORD; i <= MAXCOORD; i++) {
			print(50 * Math.cos(i / 13.0), i);
		}
		close();
		
		open();
		print(100000, 10);
		int cr = 0;
		for (int i = 0; i < 100000; i++) {
			cr += random(1, 12);
			double alpha = cr * 2 * Math.PI / 13;
			double beta = 2 * Math.PI * rnd.nextDouble();
			print(8000 * Math.cos(alpha) + 500 * Math.cos(beta), 8000 * Math.sin(alpha) + 500 * Math.sin(beta));
		}
		close();
		
		open();
		print(50000, 40000);
		for (int i = 0; i < 50; i++)
			spiral(999, rnd.nextDouble(), 1000 * rnd.nextDouble(), MAXCOORD * (rnd.nextDouble() + 1) / 2, MAXCOORD * (rnd.nextDouble() + 1) / 2);
		close();
		
		open();
		print(100000, 10);
		for (int i = 0; i < 100000; i++) {
			cr += random(1, 3);
			double alpha = cr * 2 * Math.PI / 4;
			double beta = 2 * Math.PI * rnd.nextDouble();
			print(9000 * Math.cos(alpha) + 500 * Math.cos(beta), 9000 * Math.sin(alpha) + 500 * Math.sin(beta));
		}
		close();
		
		open();
		print(100000, 10);
		for (int i = 0; i < 100000; i++) {
			double alpha = i * 2 * Math.PI / 100;
			double r = 5000 + 4000 * Math.sin(2 * alpha + Math.PI / 4);
			double beta = 2 * Math.PI * rnd.nextDouble();
			print(r * Math.cos(alpha) + 100 * Math.cos(beta), r * Math.sin(alpha) + 100 * Math.sin(beta));
		}
		close();
		
		open();
		print(100000, 100);
		for (int i = 0; i < 100000; i++) {
			double alpha = i * 2 * Math.PI / 100;
			double r = 5000 + 4000 * Math.sin(3.5 * alpha + Math.PI / 4);
			double beta = 2 * Math.PI * rnd.nextDouble();
			print(r * Math.cos(alpha) + 100 * Math.cos(beta), r * Math.sin(alpha) + 100 * Math.sin(beta));
		}
		close();
		
		open();
		print(100000, 11);
		for (int i = 0; i < 100000; i++) {
			double alpha = i * 2 * Math.PI / 1000;
			double beta = 2 * Math.PI * i / 100;
			double gamma = 2 * Math.PI * rnd.nextDouble();
			print(8000 * Math.cos(alpha) + 1000 * Math.cos(beta) + 10 * Math.cos(gamma),
					4000 * Math.sin(alpha) + 1000 * Math.sin(beta));
		}
		close();
		
		open();
		print(100000, 100000);
		for (int i = 0; i < 100000; i++) {
			double x = 9000 * Math.cos(i / 239d);
			double y = 9000 * Math.cos(i / 566d);
			double beta = 2 * Math.PI * rnd.nextDouble();
			print(x + random(1000) * Math.cos(beta), y + random(1000) * Math.sin(beta));
		}
		close();
		
		open();
		print(100000, 17);
		for (int i = 0; i < 100000; i++) {
			double x = 9000 * Math.cos(2 * Math.PI * i / 2000d);
			double y = 9000 * Math.cos(2 * Math.PI * i / 5000d);
			double beta = 2 * Math.PI * i / 10;
			print(x + 700 * Math.cos(beta) + random(20), y + 700 * Math.sin(beta) + random(20));
		}
		close();
		
		open();
		print(100000, 14);
		int cx = 0;
		int cy = 0;
		for (int i = 0; i < 100000; i++) {
			int dx, dy;
			while (true) {
				dx = cx + random(1);
				dy = cy + random(1);
				if (Math.abs(dx) > 5 || Math.abs(dy) > 5)
					continue;
				if (dx == cx && dy == cy)
					continue;
				break;
			}
			cx = dx;
			cy = dy;
			print(1900 * cx + random(50), 1900 * cy + random(50));
		}
		close();
		
		open();
		print(100000, 97);
		cx = 0;
		cy = 0;
		for (int i = 0; i < 100000; i++) {
			int dx, dy;
			while (true) {
				dx = random(2);
				dy = random(2);
				if (dx == cx && dy == cy)
					continue;
				break;
			}
			cx = dx;
			cy = dy;
			print(4900 * cx + random(100), 4900 * cy + random(100));
		}
		close();
		
		open();
		print(90000, 3);
		for (int i = 0; i < 45000; i++) {
			print(239, 566);
			print(random(MAXCOORD), random(MAXCOORD));
		}
		close();
		
		open();
		print(98000, 6);
		double x = 0;
		double y = 0;
		for (int i = 0; i < 98; i++) {
			if (Math.abs(x) > 2000 || Math.abs(y) > 2000) {
				x = random(2000);
				y = random(2000);
			}
			double xc = random(2000);
			double yc = random(2000);
			double r = Math.hypot(x - xc, y - yc);
			double ca = Math.atan2(y - yc, x - xc);
			for (int j = 0; j < 1000; j++) {
				ca += 0.01 + rnd.nextDouble();
				double rr = r * (0.8 + 0.4 * rnd.nextDouble());
				x = xc + rr * Math.cos(ca);
				y = yc + rr * Math.sin(ca);
				print(x, y);
			}
		}
		close();
	}

	public static void main(String[] args) {
		new Thread(new doall()).start();
	}
}
