#include <bits/stdc++.h>
using namespace std;
long long n, q, ar[200000], ans[200000];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 0; i < n - 1; i++) {
    q = 1;
    while (i + q * 2 < n) q *= 2;
    ar[i + q] += ar[i];
    if (i) ans[i] = ans[i - 1];
    ans[i] += ar[i];
    ar[i] = 0;
  }
  for (int i = 0; i < n - 1; i++) cout << ans[i] << endl;
  cin.get();
  cin.get();
  return 0;
}
