def check2(n): while n>1: if n%2==0: n //= 2 else: return False return True N = int(input()) a = 1 flag = -1 while 2*a<=N: if check2(a): a += 1 else: b = N-a if check2(b): a += 1 else: flag = (a,b) break if flag==-1: print(-1) else: print(*flag)