def solve(): n = int(input()) if n == 6: return "3 3" if n < 8: return -1 if bin(n)[2:].count('1') == 3 and n & 3 == 3: return f"5 {n - 5}" return f"3 {n - 3}" print(solve())