#include <bits/stdc++.h>
using namespace std;
int a[1000005], b[1000005], ans[1000005];
int main() {
  int n;
  cin >> n;
  vector<int> v;
  int y = 1;
  while (y < n) {
    v.push_back(y);
    y *= 2;
  }
  int j = v.size() - 1, x;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i < n - 1) {
      x = a[i] + b[i];
      if (i == 0)
        ans[i] = x;
      else
        ans[i] = ans[i - 1] + x;
      while (i + v[j] >= n && j < v.size()) {
        j--;
      }
      b[i + v[j]] += x;
    }
  }
  for (int i = 0; i < n - 1; i++) cout << ans[i] << endl;
  return 0;
}
