#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vector<int> bin;
  for (int i = 1; i < n;) {
    bin.push_back(i);
    i *= 2;
  }
  int it = bin.size() - 1;
  for (int i = 1; i < n; i++) {
    if (i + bin[it] > n) it--;
    ans += v[i - 1];
    v[i + bin[it] - 1] += v[i - 1];
    cout << ans << endl;
  }
  return 0;
}
