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