#include <bits/stdc++.h>
using namespace std;
int in() {
  int n;
  cin >> n;
  vector<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 b = 1;
    while (i + (b << 1) < n) b <<= 1;
    ans += a[i];
    a[i + b] += a[i];
    a[i] = 0;
    cout << ans << "\n";
  }
  return 0;
}
int main() { in(); }
