import random n=int(input()) while True: i=random.randint(-10**15,10**15) x=n-i if '7' not in str(x) and '7' not in str(i): print(i,x) exit()