#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (auto &i : a) {
    cin >> i;
  }
  long long int result = 0;
  for (long long int i = 0; i + 1 < n; i++) {
    long long int x = 1;
    while (i + x * 2 < n) {
      x *= 2;
    }
    result += a[i];
    a[i + x] += a[i];
    cout << result << endl;
  }
}
