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

class TestsGen {

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

    HashSet<Integer> was;
    final static Random rand = new Random(754);
    int testNum;

    boolean printTest(int x) {
        if (x > 1000 || was.contains(x)) {
            return false;
        }
        ++testNum;
        System.err.println("Generating test #" + testNum);
        try {
            PrintWriter out = new PrintWriter((testNum / 10) + "" + (testNum % 10));
            out.println(x);
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        was.add(x);
        return true;
    }

    void run() {
        testNum = 0;
        was = new HashSet<Integer>();
        printTest(6);
        printTest(3);
        for (int i = 0; i < 10; i++) {
            printTest(i + 2);
        }
        printTest(998);
        printTest(999);
        printTest(1000);
        for (int i = 10; i < 20; i++) {
            printTest(i + 2);
        }
        for (int i = 5; i < 10; i++) {
            printTest((1 << i) - 1);
            printTest(1 << i);
            printTest((1 << i) + 1);
        }
        int three = 27;
        while (three < 1000) {
            printTest(three - 1);
            printTest(three);
            printTest(three + 1);
            three *= 3;
        }
        for (int i = 0; i < 15; i++) {
            printTest(BigInteger.probablePrime(rand.nextInt(5) + 5, rand).intValue());
        }
        for (int i = was.size() + 1; i < 75; i++) {
            while (!printTest(rand.nextInt(999) + 2));
        }
    }
    
}   