#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 5;
int n, c = 1;
int a[N], ans[N];
void solve() {
  cin >> n;
  while (c << 1 < n) c <<= 1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n - 1; i++) {
    while (i + c > n) c >>= 1;
    a[i + c] += a[i];
    ans[i] = ans[i - 1] + a[i];
    a[i] = 0;
    cout << ans[i] << '\n';
  }
}
void setIO(string name = "") {
  cin.tie(0)->sync_with_stdio(0);
  if (name.length()) {
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  }
}
int main() {
  setIO("");
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
