import math def main(): N = int(input()) if N < 6: print(-1) elif not N & 1: print(3, N - 3) else: for i in (3, 5, 6): j = N - i if math.log2(j) % 1: print(i, j) break else: print(-1) main()