#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int memo[2000005]; int divisor(int n){ if(memo[n] != -1) return memo[n]; int ret = 0; for(int i=1; i*i<=n; i++){ if(n%i==0){ ret++; if(i!=n/i) ret++; } } return memo[n] = ret; } int main(){ rep(i,2000005) memo[i] = -1; int X; cin >> X; int val = 1 << 30; vector> v; REP(i,1,X){ int A = i; int B = X - A; int fA = A - divisor(A); int fB = B - divisor(B); int diff = abs(fA-fB); if(val == diff){ v.emplace_back(A,B); } else if(val > diff){ val = diff; v.clear(); v.emplace_back(A,B); } } rep(i,v.size()){ cout << v[i].first << " " << v[i].second << endl; } return 0; }