from random import randint s=str N=int(input()) while True: i=randint(1,N-1) j=N-i if '7' not in s(i)+s(j): print(i,j) break