#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<int> v;
  for (long long int i = 0; i < n; i++) {
    long long int p;
    cin >> p;
    v.push_back(p);
  }
  long long int prev = 0;
  for (long long int k = 1; k < n; k++) {
    long long int t = (int)(log2(n - k));
    long long int a = (k) + (int)pow(2, t);
    while (a > n) {
      t--;
      cout << t;
      a = (k) + (int)pow(2, (int)t);
    }
    v[a - 1] = v[a - 1] + v[k - 1];
    cout << prev + v[k - 1] << endl;
    prev = prev + v[k - 1];
  }
}
