from random import randint, seed
from os import path, mkdir

seed('number')

tests = set([0])

def out(*args):
	if not (path.exists("../tests")):
		mkdir("../tests")
	if len(args) == 1:
		out(min(i for i in range(len(tests) + 1) if i not in tests), *args)
		return
	print("Printing test " + str(args[0]))
	assert len(args) == 2, str(args)
	open('../tests/%02d'%args[0], 'w').write(str(args[1]) + "\n")
	tests.add(args[0])

out(23507645)

for i in range(1, 6):
	out(i)

out(0)

for i in [10, 999, 1000, 100000, 199999, 200000]:
	out(10 ** (i - 1))
	out(10 ** i - 1)
	l = i // 2
	out('1' + '0' * (l - 1) + '9' * l)
	out('9' * l + '0' * l)
	out(randint(1, 10 ** i))
	out(str(randint(1, 10 ** l)) + '0' * l)
	out(10 ** (i - 1) + randint(1, 10 ** l))
	out(10 ** (i - 1) + randint(1, 10 ** l) * 10 ** (l // 2))

for i in [10, 100, 1000, 200000]:
	out('0' * i)
	l = randint(1, i)
	out('0' * l + str(randint(1, 10 ** (i - l))))
	l = randint(1, i // 2)
	out('0' * l + str(randint(1, 10 ** (i - l))))
