#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long myarray[n];
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    myarray[i] = x;
  }
  long long powerOfTwo[17];
  for (int i = 0; i < 17; i++) {
    powerOfTwo[i] = pow(2, i);
  }
  long long counter = 0;
  for (int i = 0; i < n - 1; i++) {
    int t = 0;
    while (i + powerOfTwo[t + 1] < n && t < 17) t++;
    counter += myarray[i];
    myarray[i + powerOfTwo[t]] += myarray[i];
    myarray[i] = 0;
    cout << counter << endl;
  }
}
