encode_code = raw_input()
encode_list = encode_code.split()
print("\nthe question is\n")
str=""
for i in encode_list:
i = int(i,8)
str+=chr(i)
print str
encode_list = encode_code.split()
print("\nthe question is\n")
str=""
for i in encode_list:
i = int(i,8)
str+=chr(i)
print str