#include <bits/stdc++.h>
using namespace std;
const int SIZE = 2.1e3;
const int INF = 1e9;
int A[SIZE], dis[SIZE];
queue<int> q;
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) scanf("%d", A + i);
  for (int k = 1; k < N; ++k) {
    for (int i = 0; i < N; ++i) dis[i] = INF;
    for (int i = k; i < N; ++i) q.push(i), dis[i] = 0;
    while (!q.empty()) {
      int x = q.front();
      q.pop();
      for (int i = 1; x - i >= 0; i <<= 1)
        if (dis[x - i] > dis[x] + 1) {
          dis[x - i] = dis[x] + 1;
          q.push(x - i);
        }
    }
    int ans = 0;
    for (int i = 0; i < N; ++i) ans += A[i] * dis[i];
    printf("%d\n", ans);
  }
  return 0;
}
