#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<double> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  sort(x.begin(), x.end());
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i + 1; j++) cout << x[j] << endl;
  }
  double sum = 0;
  for (int i = 0; i < n; i++) sum += x[i];
  cout << sum << endl;
  return 0;
}
