#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int go[N], ara[N];
int ans[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ara[i];
  for (int i = 1; i < n; i++) {
    for (int j = 1; i + j <= n; j = j * 2) {
      go[i] = i + j;
    }
  }
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (ara[i] == 0) {
      ans[i] = cnt;
      continue;
    }
    cnt += ara[i];
    ara[go[i]] += ara[i];
    ans[i] = cnt;
  }
  for (int i = 1; i < n; i++) {
    cout << ans[i] << "\n";
  }
}
