#include <bits/stdc++.h>
using namespace std;
int n, p, k, s;
vector<int> v, w;
int main() {
  cin >> n;
  v.resize(n), w.resize(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n - 1; i++) {
    w = v;
    s = 0;
    for (int j = 0; j <= i; j++) {
      p = j, k = 0;
      while (p + (1 << (k + 1)) < n) k++;
      p += (1 << k);
      s += w[j], w[p] += w[j];
    }
    cout << s << endl;
  }
  return 0;
}
