#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  unsigned int t = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int power = log2(n);
  for (int i = 0; i < n - 1; i++) {
    t = i + pow(2, power);
    if (t > n - 1) {
      power--;
      t = i + pow(2, power);
    }
    count += arr[i];
    arr[t] = arr[t] + arr[i];
    cout << count << "\n";
  }
  return 0;
}
