#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  vector<int> count;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    int highestpower = log2(n - i - 1);
    count.push_back(arr[i]);
    int index = i + pow(2, highestpower);
    arr[index] = arr[index] + arr[i];
  }
  for (int i = 1; i < n; i++) {
    count[i] = count[i] + count[i - 1];
  }
  for (int i = 0; i < n - 1; i++) {
    cout << count[i] << " ";
  }
}
