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