#include <bits/stdc++.h>
using namespace std;
int pow(int a, int b) {
  int result = 1;
  for (int i = 0; i < b; i++) {
    result = result * a;
  }
  return result;
}
int max_two(int a) {
  int counter = 0;
  while (a >= 2) {
    a /= 2;
    counter++;
  }
  return counter;
}
int num_steps(int a, int b, int c) {
  int counter = 0;
  while (a < b) {
    a += pow(2, max_two(c - 1 - a));
    counter++;
  }
  return counter;
}
int main() {
  int n;
  cin >> n;
  int nums[n];
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }
  for (int j = 1; j < n; j++) {
    int sum = 0;
    for (int i = 0; i < j; i++) {
      sum += (nums[i] * num_steps(i, j, n));
    }
    cout << sum << "\n";
  }
}
