#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_slow(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;
}
vector<long long> solve_fast(const vector<int>& a) {
  vector<long long> res(a.size() - 1);
  for (int i = res.size() - 1; i >= 0; i--) {
    long long min_bits = 10000;
    for (int j = a.size() - 1; j >= i + 1; j--) {
      min_bits = min<long long>(min_bits, bitcount(j - i));
      res[j - 1] += min_bits * a[i];
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  if (true) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < a.size(); i++) cin >> a[i];
    auto res = solve_fast(a);
    for (const auto& val : res) cout << val << endl;
  } else {
    int TESTS = 100;
    int MAX = 10;
    srand(123);
    auto random = [](int max) { return rand() % max; };
    for (int TEST = 0; TEST < TESTS; TEST++) {
      int n = random(MAX) + 1;
      vector<int> a(n);
      for (int i = 0; i < a.size(); i++) a[i] = random(MAX);
      auto slow = solve_slow(a);
      auto fast = solve_fast(a);
      bool broken = false;
      for (int i = 0; i < slow.size(); i++)
        if (slow[i] != fast[i]) broken = true;
      if (broken) {
        cout << "BROKEN" << endl;
      }
    }
  }
}
