k=int(input())
num_str=str(k)
mirrored_num= num_str.translate(str.maketrans('250','520')).replace('0', '')
print(int(mirrored_num[::-1]))
input_number=int(input(""))
result= k(input_number)
print("", result)