#include <bits/stdc++.h>
using namespace std;
const static int inf = 10000000;
const static int mod = 1000000007;
int ok[2222][2222];
int main() {
  int n;
  while (cin >> n) {
    memset(ok, 0, sizeof(ok));
    vector<long long> v(n);
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(n); j++) {
        ok[i][j] = -1;
      }
    }
    for (int i = 0; i < (int)(n); i++) {
      cin >> v[i];
    }
    for (int i = 0; i < (int)(n - 1); i++) {
      for (int k = 0; k < (int)(n); k++) {
        int tt = 1;
        while (i + tt < n) {
          ok[i][k] = i + tt;
          if (i + tt > k) {
            ok[i][k] = inf;
            break;
          }
          tt *= 2;
        }
      }
    }
    for (int k = 0; k < (int)(n - 1); k++) {
      vector<long long> w(v);
      long long ans = 0;
      for (int i = 0; i < (int)(k + 1); i++) {
        ans += w[i];
        if (ok[i][k] != inf) {
          w[ok[i][k]] += w[i];
        }
      }
      cout << ans << endl;
    }
  }
  return 0;
}
