#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 2002;
int a[N], c[N];
int ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  cout << a[1];
  int counter = 0;
  for (int k = 2; k < n; k++) {
    for (int j = 1; j <= k; j++) {
      int w = n - j;
      while ((w /= 2) > 0) {
        counter++;
      }
      c[int(j + pow(2., counter))] += a[j] + c[j];
      ans += a[j] + c[j];
      counter = 0;
    }
    printf("\n%d", ans);
    ans = 0;
    for (int j = 1; j <= n; j++) c[j] = 0;
  }
  return 0;
}
