#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
long long a[N];
int main() {
  int n, i, t;
  long long ans;
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= n; i++) scanf("%I64d", a + i);
    for (i = 1, ans = 0; i < n; i++) {
      ans += a[i];
      printf("%I64d\n", ans);
      t = log2((n - i) * 1.0);
      a[i + (1 << t)] += a[i];
    }
  }
  return 0;
}
