#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  long long A[n];
  for (long long &i : A) cin >> i;
  int last = n - 1;
  long long sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (A[i] > 0) {
      int t = floor(log2(last - i));
      A[i + (1 << t)] += A[i];
      sum += A[i];
    }
    cout << sum << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
