#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int n;
long long a[100000];
void solution() {
  cin >> n;
  for (int i = 0, _n = (n); i < _n; ++i) cin >> a[i];
  long long tot = 0;
  for (int i = 0, _n = (n - 1); i < _n; ++i) {
    int add = 1;
    while (i + add * 2 < n) add *= 2;
    long long val = a[i];
    a[i] -= val;
    a[i + add] += val;
    tot += val;
    cout << tot << endl;
  }
}
int main() {
  solution();
  return 0;
}
