#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } int main(){ ios::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; vector a(n); cin >> a; sort(a.begin(), a.end()); ll r = n * (n - 1) / 2; auto f = [&](long double v){ ll res = 0; for(int i = 0, j = 0; i < n; i++){ while(j < n && a[j] <= v * a[i]) j++; res += j; } return res; }; long double ng = 0, ok = 1000000005, mid; for(int i = 0; i < 128; i++){ mid = (ng + ok) / 2; (f(mid) >= r ? ok : ng) = mid; } pair ans{1'000'000'009ll, 1}; for(int i = 0, j = 0; i < n; i++){ while(j < n && a[j] <= ng * a[i]) j++; if(j < n && a[j] * ans.second < a[i] * ans.first){ ans = {a[j], a[i]}; } } ll g = gcd(ans.first, ans.second); ans.first /= g; ans.second /= g; cout << ans.first << ' ' << ans.second << '\n'; }