#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans[n + 1];
  ans[0] = 0;
  int till = 0;
  int nn = n;
  while (nn > 0) {
    till++;
    nn = nn / 2;
  }
  int k = 1;
  for (int i = 0; i < till; i++) k = k * 2;
  for (int i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + a[i];
    while (k > n - i) k = k / 2;
    a[i + k] += a[i];
  }
  for (int i = 1; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
