#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100005];
void solve() {
  long long ans = 0;
  int len = 1;
  while (len * 2 <= n - 1) len = len * 2;
  for (int i = 0; i < n - 1; i++) {
    if (i + len >= n) len = len / 2;
    ans += a[i];
    cout << ans << endl;
    a[i + len] += a[i];
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  solve();
  return 0;
}
