#include <bits/stdc++.h>
using namespace std;
long long int dp[100008], num[100008];
int main() {
  int n, i, tmp, cnt1, cnt;
  long long ans = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> num[i];
  cnt = 1;
  while (cnt <= n) cnt *= 2;
  if (cnt > n) cnt /= 2;
  memset(dp, 0, sizeof(dp));
  for (i = 1; i <= n; i++) {
    tmp = i, cnt1 = cnt;
    while (cnt1) {
      if (cnt1 + tmp <= n) {
        dp[cnt1 + tmp] += num[i];
        tmp += cnt1;
      }
      cnt1 /= 2;
    }
  }
  for (i = 1; i < n; i++) {
    ans += dp[i] + num[i];
    cout << ans << endl;
  }
  return 0;
}
