import random N = int(input()) for i in range(10000): r = random.randint(-10**9,10**9) if str(r).count('7') > 0: continue rr = N - r if -10**9 <= rr <= 10**9 and str(rr).count('7') == 0: print(r,rr) break