#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  double a;
  vector<double> table;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a;
    table.push_back(a);
  }
  for (int i = 0; i < N - 1; i++) {
    sort(table.begin(), table.end());
    double min = table[0];
    double min2 = table[1];
    cout << min << " " << min2 << "\n";
    cout << (min + min2) / 2.0 << "\n";
    table.push_back((min + min2) / 2.0);
    table.erase(table.begin());
    table.erase(table.begin());
  }
  cout << table[0];
  return 0;
}
