#include <bits/stdc++.h>
using namespace std;
const int MAXX = 1e4 + 10;
int a[MAXX], n, ans = 0;
int next(int x) {
  int t = 0;
  while ((pow(2, t) + x) < n) t++;
  return pow(2, (t - 1)) + x;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    a[next(i)] += a[i];
    ans += a[i];
    cout << ans << endl;
  }
  return 0;
}
