#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 << 17;
int N;
int A[MAXN];
int answer;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < (int)(N); ++i) cin >> A[i];
  for (int i = 0; i < (int)(N - 1); ++i) {
    answer += A[i];
    int t = 1;
    while (i + 2 * t < N) t *= 2;
    A[i + t] += A[i];
    cout << answer << "\n";
  }
  return 0;
}
