#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  while (cin >> n) {
    long int steps = 0;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      long int a;
      cin >> a;
      v.push_back(a);
    }
    for (int k = 1; k < n; k++) {
      if (k == 1 && v[k - 1] == 0)
        cout << 0 << endl;
      else {
        int div = n - k, cnt1 = 1, indinc;
        while (div > 1) {
          div = div / 2;
          cnt1 *= 2;
        }
        indinc = k + cnt1 - 1;
        steps += v[k - 1];
        v[indinc] += v[k - 1];
        cout << steps << endl;
      }
    }
  }
}
