#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1001 * 101, MOD = 1e9 + 7;
int a[MAXN] = {};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int k = 1; k < n; k++) {
    int ans = 0, kj, j = 0, x = 0;
    for (int i = 1; i <= k; i++) {
      j = i;
      kj = 20;
      x = 0;
      ;
      while (j <= k) {
        if (j + (1 << kj) <= n) {
          j += 1 << kj;
          x++;
        }
        kj--;
      }
      ans += x * a[i - 1];
    }
    cout << ans << '\n';
  }
}
