#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
int n, a[100005];
void Load() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
}
void Solve() {
  long long cur = 0;
  for (int i = 0; i < n - 1; i++) {
    int t = 0;
    while (i + (1 << t) < n) t++;
    t--;
    cur += a[i];
    a[i + (1 << t)] += a[i];
    printf("%I64d\n", cur);
  }
}
int main() {
  Load();
  Solve();
  return 0;
}
