#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long int> a;
  vector<long long int> b;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    a.push_back(c);
  }
  int j = 0;
  long long int l = 0;
  int d = 1;
  while (j + d * 2 <= n - 1) d *= 2;
  while (j != n - 1) {
    while (j + d > n - 1 && d != 1) d = d / 2;
    while (a[j] != 0) {
      a[j + d] += a[j];
      l += a[j];
      a[j] = 0;
    }
    b.push_back(l);
    j++;
  }
  for (int i = 0; i < n - 1; i++) {
    cout << b[i] << endl;
  }
  return 0;
}
