#include <bits/stdc++.h>
using namespace std;
bool T = false;
int main() {
  int N;
  cin >> N;
  vector<pair<int, int>> pair(0);
  int ans = 1000;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int min = A[0], mindex = 0;
  for (int i = 0; i < N; i++) {
    if (min == 0 || A[i] <= min) {
      min = A[i];
      mindex = i;
    } else {
      pair.push_back(make_pair(mindex, i));
      min = 0;
    }
  }
  for (int i = 0; i < pair.size(); i++) {
    cout << A[pair[i].second] << " " << A[pair[i].first] << endl;
    ans = ans * ((double)A[pair[i].second] / A[pair[i].first]);
  }
  cout << ans << endl;
}
