#include <bits/stdc++.h>
using namespace std;
long long n;
long long A[100000];
long long power2[20];
long long incr[100000];
void genPower2() {
  power2[0] = 1;
  for (long long i = 1; i < 20; i++) power2[i] = power2[i - 1] + power2[i - 1];
}
void genIncr() {
  long long sh = 0;
  while (power2[sh] < n) sh++;
  for (long long i = 0; i < n; i++) {
    if (n - i - 1 < power2[sh]) sh--;
    incr[i] = power2[sh];
  }
}
void getResult() {
  long long curr = 0;
  for (long long i = 0; i < n - 1; i++) {
    long long temp = A[i];
    curr += temp;
    cout << curr << endl;
    A[i + incr[i]] += temp;
  }
}
int main() {
  genPower2();
  cin >> n;
  genIncr();
  for (long long i = 0; i < n; i++) cin >> A[i];
  getResult();
  return 0;
}
