def egg(n):
str_word = ''
if n == 1:
return '2'
elif n == 2:
return '3'
elif n % 2 == 1 and n != 1:
str_word = '2'
elif n % 2 == 0 and n != 2:
str_word = '3'
return str_word + egg(int((n-1)/2))
n = int(input())
print(egg(n)[::-1])
str_word = ''
if n == 1:
return '2'
elif n == 2:
return '3'
elif n % 2 == 1 and n != 1:
str_word = '2'
elif n % 2 == 0 and n != 2:
str_word = '3'
return str_word + egg(int((n-1)/2))
n = int(input())
print(egg(n)[::-1])