#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x = 1, y = 1;
  multiset<int> s;
  for (int i = 1; i <= n; i++) {
    int v;
    cin >> v;
    y = max(y, v);
    s.insert(v);
  }
  for (int i = 1; i <= y; i++)
    if (y % i == 0) s.erase(s.find(i));
  for (int i = 1; i <= 10000; i++) {
    bool tr = 1;
    for (auto o : s)
      if (i % o != 0) tr = 0;
    if (tr) cout << y << " " << i << endl, exit(0);
  }
}
