#include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; int main() { int X; cin >> X; vector d(X + 1, 0); for (int i = 1; i <= X; ++i) { for (int j = i; j <= X; j += i) ++d[j]; } int ans = 1e9; for (int i = 1; i <= X; ++i) { ans = min(ans, abs((i - d[i]) - (X - i - d[X - i]))); } for (int i = 1; i <= X; ++i) { if (abs((i - d[i]) - (X - i - d[X - i])) == ans) cout << i << " " << X - i << "\n"; } return 0; }