from random import *
seed('candies')

MAXLEN = 9
MAXN = 10**MAXLEN

test = 1
def out(a, b):
	global test
#	print (test, a, b)
	open('%02d'%test, 'w').write('%d\n%d\n'%(a, b))
	test += 1

# 20 --- 1 
# 15 - 0 :: 6 != 9 ==
# 15 - -1 :: 6 ==, 9 != 

for i in range(5):
	cnt = randint(2, MAXLEN)
	out(randint(1, 10 ** (cnt - 1) - 1), randint(10 ** (cnt - 1), 10 ** cnt))

for i in range(5):
	cnt = randint(1, MAXLEN)
	a = randint(1, 10 ** MAXLEN)
	out(a, a)

for i in range(5):
	cnt = randint(2, MAXLEN)
	out(randint(10 ** (cnt - 1), 10 ** cnt), randint(1, 10 ** (cnt - 1) - 1))

for i in range(5):
	cnt = randint(1, MAXLEN)
	a, b = randint(10 ** (cnt - 1), 10 ** cnt), randint(10 ** (cnt - 1), 10 ** cnt)
	out(max(a, b), min(a, b))

for i in range(20):
	cnt = randint(2, 9)
	cnt2 = randint(1, cnt - 1)
	cnt3 = cnt - cnt2
	pref = str(randint(10 ** (cnt2 - 1) - 1, 10 ** cnt2 - 1))
	suf1 = str(randint(10 ** (cnt3 - 1) - 1, 10 ** cnt3 - 1))
	suf2 = str(randint(10 ** (cnt3 - 1) - 1, 10 ** cnt3 - 1))
	a = int(pref + suf1)
	b = int(pref + suf2)
	out(min(a, b), max(a, b))

for i in range(10):
    l = randint(1, MAXLEN)
    bound = randint(2, 8)
    s1 = ''.join(choice(list(map(str, list(range(1, bound))))) for i in range(l))
    s2 = ''.join(choice(list(map(str, list(range(bound, 9))))) for i in range(l))
    out(int(s1), int(s2))


