#include <bits/stdc++.h>
using namespace std;
long lg2(long n) {
  long res;
  res = 1;
  for (; n > 1; n /= 2) res *= 2;
  return res;
}
vector<long> vec;
int main() {
  long n, t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    vec.push_back(t);
  }
  t = 0;
  for (int i = 0; i < n - 1; i++) {
    t += vec[i];
    vec[i + lg2(n - i - 1)] += vec[i];
    cout << t << '\n';
  }
  cin.ignore();
  cin.ignore();
  return 0;
}
