#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double tmp;
  vector<double> v;
  vector<double>::iterator it;
  double av;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    v.push_back(tmp);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  it = v.begin();
  while (v.size() > 1) {
    cout << *it << "," << *(it + 1) << endl;
    av = (*it + *(it + 1)) / 2.;
    it = v.erase(it);
    *it = av;
    sort(v.begin(), v.end());
  }
  cout << v[0] << endl;
  return 0;
}
