#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long pref[n + 1];
  long long i;
  for (i = 0; i <= n; i++) pref[i] = 0;
  long long arr[n + 1];
  long long jump[n + 1];
  for (i = 1; i <= n; i++) cin >> arr[i];
  for (i = 1; i < n; i++) {
    long long t = n - i;
    long long cnt = -1;
    while (t) {
      t /= 2;
      cnt++;
    }
    jump[i] = pow(2, cnt) + i;
  }
  for (i = 1; i < n; i++) {
    long long t = i;
    pref[i] += arr[i];
    while (jump[t] != n) pref[jump[t]] += arr[i], t = jump[t];
  }
  for (i = 2; i < n; i++) pref[i] += pref[i - 1];
  for (i = 1; i < n; i++) cout << pref[i] << "\n";
}
