#include <bits/stdc++.h>
using namespace std;
long long p[1000000];
vector<long long> v;
void f() {
  long long k = 1;
  while (k < 1000000) {
    for (long long i = k; i < k * 2 && i < 1000000; i++) p[i] = 1 + p[i - k];
    k *= 2;
  }
}
int main() {
  p[0] = 0;
  long long n;
  cin >> n;
  v.resize(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  f();
  for (long long i = 1; i < n; i++) {
    long long s = 0;
    for (long long j = 0; j < i; j++) {
      long long mi = p[i - j];
      for (long long k = i - j; k <= n - j - 1; k++)
        if (p[k] < mi) mi = p[k];
      s += mi * v[j];
    }
    cout << s << endl;
  }
  return 0;
}
