namespace AtCoder; #nullable enable using System.Numerics; static class Extensions { public static T[] Repeat(this int time, Func F) => Enumerable.Range(0, time).Select(_ => F()).ToArray(); } class AtCoder { object? Solve() { var u = 1024; var h = 8; var n = u + u - 1 + u * h + u * h * (h - 1); Out(n); var l = new List<(int, int)>(); for (var i = 1; i < u; i++) { l.Add((i, i * 2)); l.Add((i, i * 2 + 1)); } var last = u * (h + 2); for (var i = 0; i < u; i++) { var b = u + i; for (var j = 1; j <= h; j++) { var m = b + i * h + j; l.Add((b, m)); for (var k = 0; k < h - 1; k++) { l.Add((m, last)); last++; } } } foreach (var (x, y) in l) Out(x + " " + y); return null; } public static void Main() => new AtCoder().Run(); public void Run() { var res = Solve(); if (res != null) { if (res is bool yes) res = yes ? "Yes" : "No"; sw.WriteLine(res); } sw.Flush(); } string[] input = Array.Empty(); int iter = 0; readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false }; #pragma warning disable IDE0051 string String() { while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Split(' '), 0); return input[iter++]; } T Input() where T : IParsable => T.Parse(String(), null); int Int() => Input(); void Out(object? x, string? separator = null) { separator ??= Environment.NewLine; if (x is System.Collections.IEnumerable obj and not string) { var firstLine = true; foreach (var item in obj) { if (!firstLine) sw.Write(separator); firstLine = false; sw.Write(item); } } else sw.Write(x); sw.WriteLine(); } #pragma warning restore IDE0051 }