#include <bits/stdc++.h>
using namespace std;
int power[15] = {1,   2,   4,    8,    16,   32,   64,   128,
                 256, 512, 1024, 2048, 4096, 8192, 16384};
int main() {
  int nizNext[2000];
  int nizVals[2000];
  int nizValsTemp[2000];
  int nizDepth[2000];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> nizVals[i];
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 14; j >= 0; j--) {
      if (i + power[j] < n) {
        nizNext[i] = i + power[j];
        break;
      }
    }
  }
  for (int i = 1; i < n; i++) {
    int res = 0;
    for (int k = 0; k < n; k++) nizValsTemp[k] = nizVals[k];
    int count = 0;
    for (int j = 0; j < i; j++) {
      count++;
      res += nizValsTemp[j];
      nizValsTemp[nizNext[j]] += nizValsTemp[j];
    }
    printf("%d\n", res);
  }
  return 0;
}
