#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 7;
const long long INF = 1e9;
const long long mod = 1e9 + 7;
int n;
int x;
int a[N];
long long ans;
int fnd(int x) {
  int y = 0;
  while (x + (1 << (y + 1)) <= n) {
    y++;
  }
  return x + (1 << y);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    if (a[i] > 0) {
      ans += a[i];
      a[fnd(i)] += a[i];
    }
    cout << ans << endl;
  }
}
