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