#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long num[N];
long long sum[N];
int findd(int mid) {
  for (int i = 0; i < 30; i++) {
    int mm;
    mm = (int)pow(2.0, i);
    if (mm * 2 > mid) return i;
  }
}
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    memset(sum, 0, sizeof(sum));
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &num[i]);
    }
    for (int i = 1; i < n; i++) {
      int mid = n - i;
      mid = findd(mid);
      mid = (int)pow(2.0, mid);
      sum[i] += num[i] + sum[i - 1];
      num[i + mid] += num[i];
    }
    for (int i = 1; i < n; i++) printf("%I64d\n", sum[i]);
  }
}
