#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100000];
  int i, j;
  int cnt = 0;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i + 1 < n; i++) {
    cnt += a[i];
    printf("%d\n", cnt);
    for (j = 1; i + j < n; j *= 2) {
    };
    j /= 2;
    a[i + j] += a[i];
  }
  return 0;
}
