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

public class gen_carrefour {
	public static void main(String[] args) throws IOException {
		Random rand = new Random(180974);
		for (int test = 1; test <= 50; test++) {
			PrintWriter out = new PrintWriter((test / 10) + "" + (test % 10));
			switch (test) {
			case 1:
				out.println("4");
				out.println("1 3");
				out.println("1 1");
				out.println("3 1");
				out.println("2 1");
				out.println("2 2");
				break;
			case 2:
				out.println("4");
				out.println("1 2");
				out.println("1 1");
				out.println("2 1");
				out.println("3 1");
				out.println("4 1");
				break;
			case 3:
				out.println("1");
				out.println("1 4");
				out.println("1 1");
				break;
			case 4:
				out.println("1");
				out.println("3 4");
				out.println("1 100");
				break;
			case 5:
				out.println("2");
				out.println("2 3");
				out.println("3 55");
				out.println("2 55");
				break;
			case 6:
				out.println("2");
				out.println("4 2");
				out.println("4 47");
				out.println("2 47");
				break;
			case 7:
				out.println("2");
				out.println("3 1");
				out.println("4 42");
				out.println("3 42");
				break;
			case 8:
				out.println("2");
				out.println("3 1");
				out.println("4 21");
				out.println("1 21");
				break;
			case 9:
				out.println("2");
				out.println("3 4");
				out.println("4 13");
				out.println("1 13");
				break;
			case 10:
				out.println("2");
				out.println("4 3");
				out.println("4 23");
				out.println("2 23");
				break;
			case 11:
				out.println("2");
				out.println("2 4");
				out.println("1 9");
				out.println("3 9");
				break;
			case 12:
				out.println("2");
				out.println("2 3");
				out.println("1 100");
				out.println("4 100");
				break;
			case 13:
				out.println("100");
				out.println("1 3");
				{
					int[] a = new int[100];
					for (int i = 0; i < a.length; i++) {
						a[i] = i + 1;
					}
					for (int i = 0; i < a.length; i++) {
						int j = rand.nextInt(i + 1);
						int tmp = a[i];
						a[i] = a[j];
						a[j] = tmp;
					}
					for (int i = 0; i < 100; i++) {
						out.println("1 " + a[i]);
					}
				}
				break;
			case 14:
				out.println("100");
				out.println("3 2");
				{
					int[] a = new int[100];
					for (int i = 0; i < a.length; i++) {
						a[i] = i + 1;
					}
					for (int i = 0; i < a.length; i++) {
						int j = rand.nextInt(i + 1);
						int tmp = a[i];
						a[i] = a[j];
						a[j] = tmp;
					}
					for (int i = 0; i < 100; i++) {
						out.println((2 + (a[i] - 1) / 50) + " "
								+ (51 + a[i] % 50));
					}
				}
				break;
			case 15:
				out.println("100");
				out.println("1 2");
				{
					int[] a = new int[100];
					for (int i = 0; i < a.length; i++) {
						a[i] = i + 1;
					}
					for (int i = 0; i < a.length; i++) {
						int j = rand.nextInt(i + 1);
						int tmp = a[i];
						a[i] = a[j];
						a[j] = tmp;
					}
					for (int i = 0; i < 100; i++) {
						out.println((1 + (a[i] - 1) / 25) + " "
								+ (76 + a[i] % 25));
					}
				}
				break;
			case 16:
				out.println("100");
				out.println("2 4");
				{
					int[] a = new int[100];
					for (int i = 0; i < a.length; i++) {
						a[i] = i + 1;
					}
					for (int i = 0; i < a.length; i++) {
						int j = rand.nextInt(i + 1);
						int tmp = a[i];
						a[i] = a[j];
						a[j] = tmp;
					}
					for (int i = 0; i < 100; i++) {
						out.println((1 + (a[i] - 1) / 25) + " "
								+ (76 + a[i] % 25));
					}
				}
				break;
			default:
				int n = 1 + rand.nextInt(100);
				if (test >= 35) {
					n = 100;
				}
				int x = 1 + rand.nextInt(4);
				int y = 1 + rand.nextInt(3);
				if (y >= x) {
					y++;
				}
				out.println(n);
				out.println(x + " " + y);
				int[][] a = new int[4][100];
				for (int i = 0; i < a.length; i++) {
					for (int j = 0; j < a[i].length; j++) {
						a[i][j] = j + 1;
					}
					for (int j = 0; j < a[i].length; j++) {
						int k = rand.nextInt(j + 1);
						int tmp = a[i][j];
						a[i][j] = a[i][k];
						a[i][k] = tmp;
					}
				}
				int[] k = new int[4];
				for (int i = 0; i < n; i++) {
					int d = rand.nextInt(4);
					out.println((1 + d) + " " + a[d][k[d]++]);
				}
				break;
			}
			out.close();
		}
	}
}
