#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, result = 0;
  cin >> n;
  vector<long long> vec(n);
  for (int i = 0; i < n; i++) cin >> vec[i];
  for (int i = 0; i < n - 1; i++) {
    long long t = 1;
    while (n > t * 2 + i) {
      t = t * 2;
    }
    vec[i + t] += vec[i];
    result += vec[i];
    cout << result << "\n";
  }
  return 0;
}
