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 - 2 ; b > 1 ; b--){ long a = n - b; if((b % 2 == 0 && !myJudge(b)) || (a % 2 == 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 == Math.pow(2 , i)){ return false; } } return true; } }