#include <bits/stdc++.h>
using namespace std;
long long a[100000];
int main() {
  int n;
  long long res = 0;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int b;
    scanf("%d", &b);
    a[i] += b;
    b = 1;
    while (i + b * 2 < n) b *= 2;
    res += a[i];
    a[i + b] += a[i];
    cout << res << endl;
  }
  return 0;
}
