#include using namespace std; long long int d[2000005]; vector prime; int main(void) { cin.tie(0); ios::sync_with_stdio(false); bool isprime[2000005]; memset(isprime, true, sizeof(isprime)); long long int X; cin >> X; for (int i = 2; i <= 1415; i++) { if (isprime[i]) { prime.push_back(i); for (int j = 2 * i; j <= 2000000; j += i) { isprime[j] = false; } } } for (int i = 1; i <= 2000000; i++) { long long int num = 1; long long int temp = i; for (int j = 0; j < prime.size(); j++) { if (temp == 1) { break; } if (temp % prime[j] == 0) { int cnt = 0; while (1) { if (temp % prime[j] != 0) { break; } temp /= prime[j]; cnt++; } num *= (cnt + 1); } } if (temp != 1) { num *= 2; } d[i] = num; } long long int MIN = 1e18; for (long long int A = 1; A < X; A++) { long long int B = X - A; long long int FA = A - d[A]; long long int FB = B - d[B]; MIN = min(MIN, abs(FA - FB)); } for (long long int A = 1; A < X; A++) { long long int B = X - A; long long int FA = A - d[A]; long long int FB = B - d[B]; if (MIN == abs(FA - FB)) { cout << A << ' ' << B << '\n'; } } return 0; }