#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int arr[100010];
  memset(arr, 0, sizeof arr);
  int n;
  cin >> n;
  int t = 1, n2 = n;
  while (n2) {
    t <<= 1;
    n2 >>= 1;
  }
  long long int last = 0;
  for (int i = 0; i < n - 1; i++) {
    int r;
    cin >> r;
    arr[i] += r;
    while ((n - i - 1) < t) t >>= 1;
    last += arr[i];
    arr[i + t] += arr[i];
    cout << last << endl;
  }
}
