#include <bits/stdc++.h>
using namespace std;
void solve(long long n, long long original_array[]) {
  long long ans = 0, step_size;
  for (long long i = 1; i < n; i++) {
    step_size = 1;
    while (i + step_size <= n) {
      step_size *= 2;
    }
    step_size /= 2;
    ans += original_array[i];
    original_array[i + step_size] += original_array[i];
    cout << ans << endl;
  }
}
signed main() {
  long long n;
  cin >> n;
  long long original_array[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> original_array[i];
  }
  solve(n, original_array);
}
