#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long prev = 0;
  for (long long i = 0; i < n - 1; i++) {
    long long inc = 1;
    while (inc * 2 + i < n) inc *= 2;
    cout << a[i] + prev << "\n";
    a[inc + i] += a[i];
    prev += a[i];
  }
}
