#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long nums[n];
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }
  long long minPow = log(n - 1) / log(2) + 1;
  long long power = pow(2, minPow);
  long long steps = 0;
  for (int i = 0; i < n; i++) {
    while (i + power > n - 1) {
      minPow--;
      power = pow(2, minPow);
    }
    long long b = i + power;
    nums[b] += nums[i];
    steps += nums[i];
    nums[i] = 0;
    if (i != n - 1) {
      cout << steps << "\n";
    }
  }
  return 0;
}
