#include using namespace std; using ll = long long; const int D = 200; int divisor(ll n){ vector res; for(ll i = 1LL; i * i <= n; i++){ if(n % i == 0){ res.push_back(i); ll j = n / i; if(i != j)res.push_back(j); } } return res.size(); } int main() { int x; cin >> x; map>> mp; int a = x / 2, b = x - (x / 2); for(int i = -D; i <= D; i++) { if(a + i <= 0 || b - i <= 0)continue; const int A = a + i, B = b - i; mp[abs((A - divisor(A)) - (B - divisor(B)))].push_back({A, B}); } for(auto i : mp) { for(auto j : i.second)cout << j.first << " " << j.second << endl; return 0; } }