#include <bits/stdc++.h>
using namespace std;
long long int n;
int coeff(int x) {
  if (x == 0) {
    return 0;
  }
  return ((x & 1) + coeff(x >> 1));
}
void f(int ar[], int k, vector<int> coeffs) {
  long long int sum = 0;
  for (int i = 0; i <= k - 1; i++) {
    sum += ((*min_element(coeffs.begin() + k - i, coeffs.begin() + n - i)) *
            ar[i]);
  }
  cout << sum << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int ar[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  vector<int> coeffs;
  coeffs.push_back(0);
  for (int i = 1; i < n; i++) {
    coeffs.push_back(coeff(i));
  }
  for (int i = 1; i <= n - 1; i++) {
    f(ar, i, coeffs);
  }
  return 0;
}
