#include <bits/stdc++.h>
using namespace std;
vector<double> hoge;
void input(int N) {
  int temp;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    hoge.push_back(temp);
  }
}
double T(vector<double>& cont) {
  vector<double> cont2;
  cout << cont.size() << endl;
  if (cont.size() > 1) {
    int i;
    int maxsize = cont.size();
    int F = (cont.size() % 2 == 0) ? ((maxsize / 2) - 1) : ((maxsize - 1) / 2);
    if (cont.size() == 2) F = 1;
    for (i = 0; i < F; i++) {
      cont2.push_back((cont.at(2 * i) + cont.at(2 * i + 1)) / 2);
    }
    if (maxsize % 2 == 1) cont2.push_back(cont.at(F));
  } else {
    return cont.at(0);
  }
  T(cont2);
}
int main() {
  int N, sum;
  cin >> N;
  input(N);
  sort(hoge.begin(), hoge.end());
  cout << T(hoge) << endl;
}
