import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author silviase */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); split solver = new split(); solver.solve(1, in, out); out.close(); } static class split { public void solve(int testNumber, Scanner in, PrintWriter out) { int x = in.nextInt(); int[] a = new int[x + 1]; for (int i = 0; i <= x; i++) { a[i] = i; } for (int i = 1; i <= x; i++) { for (int j = 0; j <= x; j += i) { a[j]--; } } StringBuilder sb = new StringBuilder(); int min = 100000000; for (int i = 1; i < x; i++) { int cmp = Math.abs(a[i] - a[x - i]); if (min == cmp) { sb.append(i + " " + (x - i) + "\n"); } else if (min > cmp) { sb = new StringBuilder(i + " " + (x - i) + "\n"); min = cmp; } } out.print(sb.toString()); } } }