import java.util.Scanner;


public class A {

    public static void main(String[] args) {
         
        Scanner x=new Scanner(System.in);
        
        int n=x.nextInt();
                
                if(n%2==0){
                    
                    System.out.println((n-4)+" "+"4");
                }
                else{
                    
                    System.out.println((n-9)+" "+"9");
                    
                }
        
        
        
        
    }

}
