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