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