#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int acc = 0;
  for (int i = 0; i < n - 1; i++) {
    cout << acc + a[i] << '\n';
    acc += a[i];
    int k = 1;
    while (i + 2 * k < n) k = 2 * k;
    a[i + k] += a[i];
  }
  return 0;
}
