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