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