#include <bits/stdc++.h>
using namespace std;
int main() {
  long long r, S, Z, s1, s2, s3, s4, s5, s6, x, y, z, n, m, i, j, l, k, t;
  long long a[100001];
  long long b[200001];
  long long c[100001];
  long long d[100001];
  string q;
  string s;
  string sq[3001];
  map<long long, long long> g;
  map<long long, long long>::iterator it;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  x = 1;
  for (i = 1; i <= 64; i++) {
    x = x * 2;
    if (x >= n) {
      x = x / 2;
      break;
    }
  }
  k = 0;
  for (i = 1; i < n; i++) {
    if (i + x <= n) {
      a[i + x] = a[i + x] + a[i];
    } else {
      x = x / 2;
      a[i + x] = a[i + x] + a[i];
    }
    k = k + a[i];
    cout << k << endl;
  }
}
