import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextInt(),i; sc.close(); if(n-3>2&&n!=7) { for(i=2;i<60;++i) if((long)Math.pow(2, i)==n-3) break; if(i==60) System.out.print("3 "+(n-3)); else System.out.print("5 "+(n-5)); } else System.out.print(-1); } }