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: print(str(min(6,N-6)) + " " + str(max(6,N-6))) else: print(str(min(3,N-3))) + " " + str(max(3,N-3))