#include <bits/stdc++.h>
using namespace std;
int getoff(int v) {
  int z = 1;
  while (z <= v) {
    z *= 2;
  }
  if (z > v) z /= 2;
  return z;
}
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int times = 0;
  for (int i = 1; i <= n - 1; i++) {
    int off = getoff(n - i);
    times += a[i];
    a[i + off] += a[i];
    cout << times << endl;
  }
  cin >> n;
  return 0;
}
