#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w, e, r, a[100000];
  long long t = 0;
  scanf("%d", &q);
  for (w = 0; w < q; w++) scanf("%d", &a[w]);
  for (w = 0; w < q - 1; w++) {
    for (e = 1; (e << 1) + w < q; e <<= 1)
      ;
    t += a[w];
    a[e + w] += a[w];
    printf("%I64d\n", t);
  }
  return 0;
}
