#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  vector<int> ar(n), temp_ar(n);
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  int number_of_moves = 0;
  for (int k = 0; k < n - 1; k++) {
    number_of_moves = 0;
    for (int i = 0; i < n; i++) {
      temp_ar[i] = ar[i];
    }
    for (int i = 0; i <= k; i++) {
      if (temp_ar[i] > 0) {
        int j = 0;
        while (i + (1 << (j + 1)) < n) {
          j++;
        }
        int min_ind = i + (1 << j);
        temp_ar[min_ind] += temp_ar[i];
        number_of_moves += temp_ar[i];
        temp_ar[i] = 0;
      }
    }
    cout << number_of_moves << endl;
  }
  return 0;
}
