#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
  return is >> p.first >> p.second;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p) {
  return os << p.first << " " << p.second;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  long long ans = 0;
  for (int i = 0; i + 1 < n; i++) {
    int t = 0;
    while (i + (1 << t + 1) < n) t++;
    ans += v[i];
    v[i + (1 << t)] += v[i];
    v[i] = 0;
    cout << ans << "\n";
  }
}
