#include <bits/stdc++.h>
using namespace std;
int n;
long long second, a[2000000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%I64d", &a[i]);
  for (int i = 1; i < n; ++i) {
    int l = 31 - __builtin_clz(n - i);
    second += a[i];
    a[i + (1 << l)] += a[i];
    printf("%I64d\n", second);
  }
  return 0;
}
