#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long a[100010];
  pair<long long, long long> p[100010];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    int l = i;
    for (int j = 20; j >= 0; j--) {
      int num = (1 << j);
      if (l + num <= n) {
        p[i].first = i;
        p[i].second = l + num;
        break;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n - 1; i++) {
    long long nxt = p[i].second;
    a[nxt] += a[i];
    ans += a[i];
    a[i] = 0;
    cout << ans << endl;
  }
  if (n == 1) cout << 0;
  cout << endl;
  return 0;
}
