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

public class TestsGen {

	static int testNum = 0;
	static final Random rand = new Random(123123L);

	static void printTest(Test t) {
		++testNum;
		System.err.println("[" + testNum + "]");
		String fileName = testNum / 10 + "" + testNum % 10;
		try {
			PrintWriter out = new PrintWriter(fileName);
			out.println(t.n + " " + t.m + " " + t.k);
			for (Point e : t.p1) {
				out.println(e.x + " " + e.y);
			}
			for (Point e : t.p2) {
				out.println(e.x + " " + e.y);
			}
			out.close();
		} catch (IOException e) {
		 	e.printStackTrace();
		}
	}

	static class Point {
		int x;
		int y;

		Point(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int hashCode() {
			return x * 100007 + y;
		}

		@Override
		public boolean equals(Object o) {
			Point p = (Point) o;
			return x == p.x && y == p.y;
		}
	}

	static class Test {
		int n;
		int m;
		int k;
		Point[] p1;
		Point[] p2;

		Test(int n, int m, int k, Point[] p1, Point[] p2) {
			this.n = n;
			this.m = m;
			this.k = k;
			this.p1 = p1;
			this.p2 = p2;
		}
	}

	public static void main(String[] args) {
		printTest(new Test(2, 3, 4, new Point[] { new Point(1, 1), new Point(1, 2) }, 
							new Point[] { new Point(1, 3), new Point(1, 4), new Point(1, 5) }));
        printTest(new Test(1, 1, 2, new Point[] { new Point(1, 1) }, new Point[] { new Point(1, 10) } ));
        printRandomTest(100, 100, 200, 10000);
        printRandomTest(100, 100, 150, 10000);
        printRandomTest(100, 100, 100, 10000);
        for (int i = 0; i < 15; i++) {
        	int n = random(1, 100);
        	int m = random(1, 100);
        	int k = random(Math.max(n, m) + 1, n + m + 1);
        	printRandomTest(n, m, k, 10000);
        }

        for (int i = 0; i < 5; i++) {
        	int n = random(1, 100);
        	int m = random(1, 100);
        	int k = random(Math.max(n, m) + 1, n + m + 1);
        	printRandomTest(n, m, k, 100);
        }
        
        for (int i = 0; i < 5; i++) {
        	int n = random(1, 5);
        	int m = random(1, 5);
        	int k = random(Math.max(n, m) + 1, n + m + 1);
        	printRandomTest(n, m, k, 10);
        }

        for (int i = 0; i < 5; i++) {
        	int n = random(1, 15);
        	int m = random(1, 15);
        	int k = random(Math.max(n, m) + 1, n + m + 1);
        	printRandomTest(n, m, k, 10);
        }

        for (int i = 0; i < 5; i++) {
        	int n = random(1, 10);
        	int m = random(1, 10);
        	int k = random(Math.max(n, m) + 1, n + m + 1);
        	printRandomTest(n, m, k, 10000);
        }

        for (int i = 0; i < 5; i++) {     
        	int n = random(1, 100);
        	int m = random(1, 100);
        	int k = random(1, Math.min(n, m) + 1);
        	printRandomTest(n, m, k, 100);
        }

        for (int i = 0; i < 5; i++) {     
        	int n = random(1, 100);
        	int m = random(1, 100);
        	int k = random(Math.min(n, m), Math.max(n, m) + 1);
        	printRandomTest(n, m, k, 10000);
        }
	}

	static void printRandomTest(int n, int m, int k, final int MAXX) {
		Point[] p1 = new Point[n];
		Set<Point> set = new HashSet<Point>();
		for (int i = 0; i < n; i++) {
			Point e;              
			do {
				e = new Point(random(-MAXX, MAXX + 1), random(-MAXX, MAXX + 1));
			} while (!set.add(e));
			p1[i] = e;
		}
		Point[] p2 = new Point[m];
		for (int i = 0; i < m; i++) {
			Point e;
			do {
				e = new Point(random(-MAXX, MAXX + 1), random(-MAXX, MAXX + 1));
			} while (!set.add(e));
			p2[i] = e;
		}
		printTest(new Test(n, m, k, p1, p2));
	}

	static int random(int l, int r) {
		return rand.nextInt(r - l) + l;
	}
}