import java.io.*; import java.util.*; public class Main_yukicoder638 { private static Scanner sc; private static Printer pr; private static void solve() { long n = sc.nextLong(); Set hs = new HashSet<>(); for (int i = 0; i < 61; i++) { hs.add(1L << i); } for (long i = 3; i <= n - i; i++) { if (hs.contains(i) || hs.contains(n - i)) { continue; } pr.printf("%d %d\n", i, n - i); return; } pr.println(-1); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }