import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long base = 1; HashSet ng = new HashSet<>(); while (base <= n) { ng.add(base); base *= 2; } for (long i = 1; i <= n / 2; i++) { if (!ng.contains(i) && !ng.contains(n - i)) { System.out.println(i + " " + (n - i)); return; } } System.out.println(-1); } }