#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmax;
  long long total = 0;
  cin >> n;
  long long a[n + 1];
  for (int x = 1; x <= n; ++x) cin >> a[x];
  for (int i = 1; i <= n - 1; ++i) {
    if (a[i] != 0) {
      tmax = (int)log2((n - i) * 1.0);
      total += a[i];
      a[i + (int)pow(2.0, tmax)] += a[i];
      a[i] = 0;
    }
    cout << total << endl;
  }
  return 0;
}
