#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> ar(n);
  for (long long i = 0; i < n; i++) cin >> ar[i];
  vector<long long> ans(n - 1);
  long long xx = log2(n - 1 - 0);
  long long yy = pow(2, xx);
  ar[0 + yy] += ar[0];
  ans[0] = ar[0];
  ar[0] = 0;
  for (long long i = 1; i < n - 1; i++) {
    long long xx = log2(n - 1 - i);
    long long yy = pow(2, xx);
    ar[i + yy] += ar[i];
    ans[i] = ans[i - 1] + ar[i];
    ar[i] = 0;
  }
  for (long long x : ans) cout << x << "\n";
  return 0;
}
