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