// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define SI(a) a.size()
#define vec vector
template <typename T> bool chmin(T &x, T y) {
	if (y < x) {
		x = y;
		return true;
	}
	return false;
}
template <typename T> bool chmax(T &x, T y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}
void solve() {
	int n;
	cin >> n;
	using ld = long double;
	vec<long> c(n);
	rep(i, n) cin >> c[i];
	sort(c.begin(), c.end());
	int idx = -1;
	ld val = -1;
	for (int i = 1; i < n; i++) {
		ld val2 = c[i - 1];
		val2 /= c[i];
		if (val < val2) {
			idx = i;
		}
	}
	long c1 = c[idx - 1], c2 = c[idx];
	long g = gcd(c1, c2);
	cout << c1 / g << " " << c2 / g << endl;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
}