#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, c = 0;
  cin >> n;
  long long int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    int k = floor(log2(n - 1 - i));
    while (a[i] != 0) {
      int p = (pow(2, k));
      a[i + p] = a[i + p] + a[i];
      c = c + a[i];
      a[i] = 0;
    }
    b[i] = c;
  }
  for (int i = 0; i < n - 1; i++) {
    cout << b[i] << endl;
  }
}
