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