#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n, t, moves = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    t = n - i - 1;
    int x = floor(log(t) / log(2));
    int y = i + pow(2, x);
    moves += a[i];
    a[y] += a[i];
    cout << moves << "\n";
  }
}
