#include <bits/stdc++.h>
using namespace std;
long long int N, A[100005];
void read() {
  cin >> N;
  for (long long int i = 1; i <= N; i++) cin >> A[i];
}
void solve() {
  long long int i, m, t = 0;
  for (i = 1; i < N; i++) {
    t += A[i];
    cout << t << endl;
    m = 1;
    while (i + (m << 1) <= N) m <<= 1;
    A[i + m] += A[i];
  }
}
int main() {
  read();
  solve();
}
