#include <bits/stdc++.h>
using namespace std;
const int dl = 1e9 + 7;
const int M = 1e5 + 10;
int a[M];
int t;
int n;
int to[M];
int main() {
  cin >> n;
  to[n - 1] = 1;
  for (int i = 2; i < n; i++) {
    to[n - i] = to[n - i / 2] * 2;
  }
  for (int i = 1; i <= n; i++) cin >> a[i];
  int t = 0;
  for (int i = 1; i < n; i++) {
    t += a[i];
    a[i + to[i]] += a[i];
    cout << t << endl;
  }
  return 0;
}
