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

public class FibTestsGen implements Runnable {
    public static void main(String[] args) {
        if (args.length < 1) {
        	for (I = 1; (new File(getName(I) + ".t")).exists(); I++);
        } else {
            I = Integer.parseInt(args[0]);
        }
        new Thread(new FibTestsGen()).start();
    }

    PrintWriter out;

    Random random = new Random(6466403L);

    static int I;

    static String getName(int i) {
    	return ((i < 10) ? "0" : "") + i;
    }
    
    void open() {
        try {
        	System.out.println("Generating test " + I);
            out = new PrintWriter(getName(I));
        } catch (FileNotFoundException e) {        	
        	e.printStackTrace();
        	System.exit(-1);
        }
    }


    final int MAXT = 100;
    final int MAXN = 45;

    void close() {
        out.close();
        I++;
    }

    void gen(int t, int maxnum) {
    	open();
    	
    	out.println(t);
    	for (int i = 0; i < t; i++) {
    		int num = random.nextInt(maxnum + 1);
    		out.println(num + " " + (random.nextInt(LEN[num]) + 1));
    	}

    	close();
    }

    int[] LEN;

    public void solve() throws IOException {
    	LEN = new int[MAXN + 1];
    	LEN[0] = 1;
    	LEN[1] = 1;
    	for (int i = 2; i <= 45; i++) {
    		LEN[i] = LEN[i - 1] + LEN[i - 2];
    	}


    	for (int k = 0; k < 10; k++) {
    		gen(random.nextInt(10) + 1, 10);
    	}

    	for (int k = 0; k < 10; k++) {
    		gen(random.nextInt(30) + 1, MAXN);
    	}

    	for (int k = 0; k < 10; k++) {
    		gen(random.nextInt(MAXT) + 1, MAXN);
    	}

    	for (int k = 0; k < 10; k++) {
    		gen(MAXT, MAXN);
    	}

    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }
}
