import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long ansA = -1; long ansB = -1; for(long b = n - 2l ; b > 1 ; b--){ long a = n - b; if((b % 2l == 0 && !myJudge(b)) || (a % 2l == 0 && !myJudge(a))){ continue; } ansA = a; ansB = b; break; } System.out.println(ansA == -1 ? -1 : ansA+" "+ansB); } private static boolean myJudge(long num){ for(int i = 1 ; i < 61 ; i++){ if(num == (long) Math.pow(2 , i)){ return false; } } return true; } }