#include <bits/stdc++.h>
using namespace std;
long long a[100010], ans[100010];
long long cl(long long x) {
  long long g = 131072;
  while (g > x) {
    g >>= 1;
  }
  return g;
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    long long x = n - i;
    long long N = cl(x);
    ans[i] = ans[i - 1];
    ans[i] += a[i];
    a[i + N] += a[i];
  }
  for (long long i = 1; i < n; i++) cout << ans[i] << '\n';
  return 0;
}
