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