#include <bits/stdc++.h>
int main() {
  int n, i, t;
  long long a[200000], ans = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (i = 0; i < n - 1; i++) {
    t = 1;
    while (i + 1 + t <= n) t *= 2;
    t /= 2;
    ans += a[i];
    a[i + t] += a[i];
    printf("%I64d\n", ans);
  }
}
