import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Random;

public class Tests {
    int testNo = 1;

    PrintWriter comment;

    String compress(BigInteger a) {
        if (a.toString().length() <= 15) {
            return a.toString();
        } else {
            String t = a.toString();
            return t.substring(0, 5) + "..[" + (t.length() - 10) + " digits].." + t.substring(t.length() - 5);
        }
    }

    public void printTest(BigInteger a, BigInteger b) {
        PrintWriter out = null;
        try {
            out = new PrintWriter("tests/" + testNo / 10 + testNo % 10);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return;
        }

        out.println(a);
        out.println(b);
        out.close();

        comment.println("                    <test points = \"" + 0 + "\" comment = \"" + compress(a) + " " + compress(b) + "\" />");

        testNo++;
    }

    void printTest(long a, long b) {
        printTest(BigInteger.valueOf(a), BigInteger.valueOf(b));
    }

    void printTest(String a, String b) {
        printTest(new BigInteger(a), new BigInteger(b));
    }

    String mul(String s, int c) {
        String r = "";
        for (int i = 0; i < c; i++) {
            r += s;
        }
        return r;
    }

    Random rnd = new Random(23984729047L);

    String randomString(int l) {
        String r = "" + "123456789".charAt(rnd.nextInt(9));
        for (int i = 0; i < l - 1; i++) {
            r += "0123456789".charAt(rnd.nextInt(10));
        }
        return r;
    }

    public void run() throws FileNotFoundException {
        comment = new PrintWriter("comments");

        printTest(3, 4);
        printTest(3, 0);
        printTest(0, 3);
        printTest(0, 0);
        printTest(10, 10);
        printTest(1000000000, 1000000000);
        printTest(1000000000, 0);
        printTest(999999999, 1);
        printTest(454545454, 545454545);
        printTest(333333333, 666666666);
        printTest(333333333, 666666667);
        printTest(333333333, 777777777);
        printTest(999999999, 999999999);
        printTest(213146546, 455564564);

        printTest(-2, 3);
        printTest(3, -2);
        printTest(10, -10);
        printTest(-1000000000, -1000000000);
        printTest(-1000000000, 1000000000);
        printTest(1000000000, -1000000000);
        printTest(0, -1000000000);
        printTest(0, -1000000000);
        printTest(111111111, -999999999);
        printTest(-111111111, 999999999);
        printTest(-111111111, -999999999);

        printTest("9998239479284729047", "28934720947823094790");
        printTest("1" + mul("0", 100), "1" + mul("0", 100));
        printTest(mul("9", 100), mul("9", 100));
        printTest(mul("1", 100), mul("9", 100));
        printTest(mul("3", 100), mul("6", 100));
        printTest(mul("6", 100), mul("4", 100));
        printTest(mul("45", 50), mul("54", 50));
        printTest(randomString(100), randomString(100));
        printTest(randomString(100), randomString(10));
        printTest(randomString(10), randomString(100));

        printTest("-9998239479284729047", "28934720947823094790");
        printTest("-1" + mul("0", 100), "1" + mul("0", 100));
        printTest("-1" + mul("0", 100), "-1" + mul("0", 100));
        printTest("1" + mul("0", 100), "-1" + mul("0", 100));
        printTest(mul("9", 100), "-" + mul("9", 100));
        printTest(mul("9", 100), "-" + mul("9", 100));
        printTest(mul("1", 100), "-" + mul("9", 100));
        printTest("-" + mul("1", 100), mul("9", 100));
        printTest(mul("1", 100), "-" + mul("9", 50) + mul("1", 50));
        printTest(mul("3", 100), "-" + mul("6", 100));
        printTest(mul("6", 100), "-" + mul("4", 100));
        printTest(randomString(100), "-" + randomString(100));
        printTest(randomString(100), "-" + randomString(10));
        printTest(randomString(10), "-" + randomString(100));
        printTest("-" + randomString(100), "-" + randomString(100));
        printTest("-" + randomString(100), "-" + randomString(10));
        printTest("-" + randomString(10), "-" + randomString(100));

        comment.close();
    }

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