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