import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); long n = sc.nextLong(); Set prohibited = IntStream.range(0, 60).mapToLong(i -> (1L << i)).boxed() .collect(Collectors.toCollection(HashSet::new)); long ans = LongStream.rangeClosed(1, n / 2) .filter(i -> !prohibited.contains(i) && !prohibited.contains(n - i)).findFirst().orElse(-1); System.out.println(ans == -1 ? "-1" : ans + " " + (n - ans)); } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }