import math N = int(input()) two_pow = [1] bit = 1 while bit < N: bit <<= 1 two_pow.append(bit) if N % 2 == 1: if N < 9: print(-1) else: num = 3 while (num in two_pow) or ((N-num) in two_pow): num += 1 else: print(str(num) + " " + str(N-num)) else: if N < 6: print(-1) else: print(str(min(3,N-3)) + " " + str(max(3,N-3)))