#include #define ll long long #define ALL(v) (v).begin(),(v).end() #define REP(i,p,n) for(int i=p;i<(int)(n);++i) #define rep(i,n) REP(i,0,n) #define dump(a) (cerr << #a << "=" << (a) << endl) #define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } using namespace std; int main(){ int d[2001000]; for(int i = 1; i <= 2e6; i++) { for(int j = i; j <= 2e6; j += i) { d[j]++; } } int X; cin >> X; int Y = X; int m = 0; while(Y > 0) { m++; Y /= 2; } ll mim = 100101001010101; REP(i, X/2 - sqrt(X), X/2+sqrt(X)) { int j = X - i; if (i > 0 && j > 0) { // cout << d(i) << endl; ll res = i - j - d[i] + d[j]; // cout << abs(res) << endl; chmin(mim, abs(res)); } } REP(i, X/2 - sqrt(X) , X/2 + sqrt(X)) { int j = X - i; if (i > 0 && j > 0) { ll res = i - j - d[i] + d[j]; // cout << i << " " << abs(res) << endl; if (mim == abs(res)) { cout << i << " " << j << endl; } } } }