#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int i, t, p;
  long long int sum = 0;
  for (i = 0; i <= n - 2; i++) {
    t = floor((double)log2(n - 1 - i));
    p = pow(2, (int)t);
    a[i + p] += a[i];
    sum += a[i];
    cout << sum << endl;
  }
  return 0;
}
