import random n=int(input()) for _ in range(10000): i=random.randint(-10**9,10**9+1) x=n-i if '7' not in str(x) and '7' not in str(i): print(i,x) exit()