#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  int a[10000], total = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long i = 0; i < n - 1; i++) {
    for (int j = n; j >= 0; j--) {
      if (i + pow(2, j) < n) {
        a[int(i + pow(2, j))] += a[i];
        break;
      }
    }
    total += a[i];
    cout << total << '\n';
  }
  return 0;
}
