import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;

public class TestGen {
    final int MAXN = (int) 1000;
    final int MAXA = (int) 100;
    final int MAXC = (int) 10000;

    final Random rand = new Random(3056732867464634634L);

    int currentTestNumber = 0;

    int[] a(int... a) {
        return a;
    }

    void hands() {
        print(a(1, 2, 4), a(1, 2, 3));
        print(a(3), a(1));
        print(a(1), a(4));
        print(a(2, 4), a(1, 1));
        print(a(2, 4, 9), a(1, 1, 1));
        print(a(2, 4, 11), a(1, 1, 1));
    }

    void maxN() {
        int[] a = new int[MAXN];
        int[] c = new int[MAXN];
        for (int i = 0; i < MAXN; i++) {
            a[i] = rand.nextInt(MAXA) + 1;
            c[i] = rand.nextInt(MAXC) + 1;
        }
        print(a, c);
    }

    void maxAC() {
        int[] a = new int[MAXN];
        int[] c = new int[MAXN];
        for (int i = 0; i < MAXN; i++) {
            a[i] = MAXA;
            c[i] = MAXC;
        }
        print(a, c);
    }

    void fewAC() {
        int[] a = new int[MAXN];
        int[] c = new int[MAXN];
        for (int i = 0; i < MAXN; i++) {
            a[i] = 1;
            c[i] = rand.nextInt(2) + 1;
        }
        print(a, c);
    }

    void smallRandom() {
        int n = rand.nextInt(10) + 1;
        int[] a = new int[n];
        int[] c = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = rand.nextInt(20) + 3;
            c[i] = rand.nextInt(31) + 1;
        }
        print(a, c);
    }

    void bigRandom() {
        int n = MAXN - rand.nextInt(10);
        int[] a = new int[n];
        int[] c = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = MAXA - rand.nextInt(20);
            c[i] = MAXC - rand.nextInt(31);
        }
        print(a, c);
    }

    void justRandom() {
        int n = rand.nextInt(MAXN) + 1;
        int[] a = new int[n];
        int[] c = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = rand.nextInt(MAXA) + 1;
            c[i] = rand.nextInt(MAXC) + 1;
        }
        print(a, c);
    }


    public void run() {
        hands();
        maxN();
        maxAC();
        for (int i = 0; i < 10; i++) {
            smallRandom();
        }
        for (int i = 0; i < 10; i++) {
            bigRandom();
        }
        for (int i = 0; i < 10; i++) {
            fewAC();
        }
        for (int i = 0; i < 10; i++) {
            justRandom();
        }
    }

    public static void main(String[] args) {
        new TestGen().run();
    }

    void print(int[] a, int[] c) {
        if (a.length != c.length) {
            throw new AssertionError();
        }
        currentTestNumber++;
        PrintWriter out = null;
        try {
            new File("../tests").mkdirs();
            out = new PrintWriter(String.format("../tests/%02d", currentTestNumber));
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
        Arrays.sort(a);
        Arrays.sort(c);
        int n = a.length;
        int[] ids = new int[n];
        for (int i = 0; i < n; i++) {
            ids[i] = i;
        }
        shuffle(ids);
        out.println(n);
        for (int i : ids) {
            out.printf("%d %d%n", a[i], c[i]);
        }
        out.close();
    }

    void shuffle(int[] a) {
        for (int i = 1; i < a.length; i++) {
            int x = rand.nextInt(i + 1);
            int t = a[i];
            a[i] = a[x];
            a[x] = t;
        }
    }
}
