def solve(): n = int(input()) if n == 11: return "5 6" if n == 7 or n < 6: return "-1" return f"3 {n - 3}" print(solve())