#include <bits/stdc++.h>
using namespace std;
const long double epsilon = 1e-9;
long long v[1 << 17];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i]);
  }
  long long cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    int idx = 1;
    while (i + idx < n) {
      idx *= 2;
    }
    idx /= 2;
    cnt += v[i];
    v[i + idx] += v[i];
    cout << cnt << endl;
  }
  return 0;
}
