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