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