n = int(input()) for i in range(3, n//2+1): if bin(i).count("1") > 1 and bin(n-i).count("1") > 1: print(i, n-i) break else: print(-1)