#include <bits/stdc++.h>
using namespace std;
int bitcount(int val) {
  int res = 0;
  while (val > 0) {
    if (val % 2 == 1) res++;
    val /= 2;
  }
  return res;
}
vector<int> solve(const vector<int>& a) {
  auto cost_single = [&a](int first, int position) -> int {
    int res = 10000;
    for (int go_to = first + 1; go_to < a.size(); go_to++) {
      int delta = go_to - position;
      res = min(res, bitcount(delta));
    }
    return res;
  };
  auto cost_first = [&a, &cost_single](int first) -> int {
    int res = 0;
    for (int i = 0; i <= first; i++) {
      res += cost_single(first, i) * a[i];
    }
    return res;
  };
  vector<int> res(a.size() - 1);
  for (int i = 0; i < res.size(); i++) {
    res[i] = cost_first(i);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < a.size(); i++) cin >> a[i];
  auto res = solve(a);
  for (const auto& val : res) cout << val << endl;
}
