import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long N = scan.nextLong(); scan.close(); if(N == 1 || N == 2 || N == 4 || N == 5 || N == 7) { System.out.println(-1); System.exit(0); } if(Long.bitCount(N - 3) != 1) { long b = N - 3; System.out.println(3 + " " + b); }else if(Long.bitCount(N - 5) != 1) { long b = N - 5; System.out.println(5 + " " + b); }else { System.out.println(-1); } } }