#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, a = 1;
  cin >> n;
  vector<int> v(n), v1, ans(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  while (a + 1 <= n) {
    v1.push_back(a);
    a *= 2;
  }
  int c = 0, j = v1.size() - 1;
  for (int i = 0; i < n - 1; i++) {
    if (i == 0)
      ans[i] = v[i];
    else
      ans[i] = v[i] + ans[i - 1];
    while (i + v1[j] + 1 > n) j--;
    v[i + v1[j]] += v[i];
  }
  for (int i = 0; i < n - 1; i++) cout << ans[i] << endl;
  return 0;
}
