#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, i, j, n;
  cin >> n;
  vector<int> v1, v;
  for (i = 0; i <= 30; i++) {
    a = pow(2, i);
    v1.push_back(a);
  }
  for (i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  int ans = 0;
  for (i = 0; i < n - 1; i++) {
    b = 1;
    for (j = v1.size() - 1; j >= 0; j--) {
      if ((v1[j] + i) < n) {
        b = v1[j];
        break;
      }
    }
    ans = ans + v[i];
    cout << ans << endl;
    v[i + b] += v[i];
  }
}
