from os import *
from io import *
import random


def printTest1(testNo, i):
	if not (path.exists("../tests")):
		mkdir("../tests")
	tst = open("../tests/%d%d" % divmod(testNo, 10), "w")
	tst.write(str(test1[i]) + "\n");
	tst.close()

def test(testNo, x):
	if not (path.exists("../tests")):
		mkdir("../tests")
	tst = open("../tests/%d%d" % divmod(testNo, 10), "w")
	tst.write(str(x) + "\n");
	tst.close()

def test31(testNo, x):
	if not (path.exists("../tests")):
		mkdir("../tests")
	tst = open("../tests/%d%d" % divmod(testNo, 10), "w")
	for i in range(10000):
		tst.write("9");
	tst.write("\n");
	tst.close()

def test_rand(testNo, x):
	if not (path.exists("../tests")):
		mkdir("../tests")
	tst = open("../tests/%d%d" % divmod(testNo, 10), "w")
	c = random.randint(1, 9)
	tst.write(str(c));
	for i in range(9999):
		c = random.randint(0, 9)
		tst.write(str(c));

	tst.write("\n");
	tst.close()


test1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 1098, 1099, 1998, 1999, 10998, 10999]
testNo = 0
for i in range(22):
	testNo = testNo + 1
	printTest1(testNo, i);

testNo = testNo + 1
x = 2 * ((10**500) - 1)
test(testNo, x);

testNo = testNo + 1
x += 1
test(testNo, x);

testNo = testNo + 1
x = 11 * (10**250) - 2
test(testNo, x)

testNo = testNo + 1
x += 1
test(testNo, x);

testNo = testNo + 1
x = 11 * (10**9999) - 2
test(testNo, x)

testNo = testNo + 1
x += 1
test(testNo, x);

testNo = testNo + 1
x = 2 * ((10**9999) - 1)
test(testNo, x);

testNo = testNo + 1
x += 1
test(testNo, x);

testNo = testNo + 1
test31(testNo, x);
random.seed(313110);
for i in range(19):
	testNo = testNo + 1
	test_rand(testNo, x);


