#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long int lim(long long int a, long long int n) {
  long long int power = 0;
  while (a + pow(2, power) <= n) {
    power++;
  }
  return power - 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> a(n), ans(n - 1);
  for (auto &i : a) cin >> i;
  for (long long int i = 0; i < n - 1; ++i) {
    if (i == 0)
      ans[i] = a[i];
    else
      ans[i] = ans[i - 1] + a[i];
    a[i + pow(2, lim(i, n - 1))] += a[i];
    a[i] = 0;
  }
  for (auto &i : ans) cout << i << '\n';
  return 0;
}
