#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1000000007 //#define MOD 998244353 #define LINF (long long)4e18 #define jck 3.141592 const double EPS = 1e-10; using ll = long long; using Pi = pair; using Pl = pair; set divisor(ll n){ set s; for(ll i = 1; i*i <= n; i++){ if(n % i == 0){ s.insert(i); s.insert(n/i); } } return s; } int main(){ int X; cin >> X; int d = X/2; int now = INF; vector ans[1000]; repr(i,max(1,d-100),d+1){ int d2 = X-i; if(d2 <= 0) continue; set div = divisor(i); set div2 = divisor(d2); int f = abs(i-d2-(int)div.size()+(int)div2.size()); if(f <= now){ now = f; ans[f].push_back(Pi(i,d2)); } } rep(i,ans[now].size()){ cout << ans[now][i].first << " " << ans[now][i].second << endl; } for(int i = ans[now].size()-1; i >= 0; i--){ if(ans[now][i].first == ans[now][i].second) continue; cout << ans[now][i].second << " " << ans[now][i].first << endl; } }