#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n;
int a[N];
long long tr[N * 4];
void pushdown(int p, int l, int r) {
  tr[(p << 1)] += tr[p];
  tr[(p << 1 | 1)] += tr[p];
  tr[p] = 0;
}
void update(int p, int l, int r, int ll, int rr, int x) {
  if (ll > r || rr < l) return;
  if (ll <= l && rr >= r) {
    tr[p] += x;
    return;
  }
  pushdown(p, l, r);
  update((p << 1), l, ((l + r) >> 1), ll, rr, x);
  update((p << 1 | 1), ((l + r) >> 1) + 1, r, ll, rr, x);
}
long long query(int p, int l, int r, int ll) {
  if (ll > r || ll < l) return 0;
  if (l == r) {
    return tr[p];
  }
  pushdown(p, l, r);
  return query((p << 1), l, ((l + r) >> 1), ll) +
         query((p << 1 | 1), ((l + r) >> 1) + 1, r, ll);
}
int getmx(int x) {
  for (int i = 20; i >= 0; --i) {
    if (x + (1 << i) <= n) {
      return x + (1 << i);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
  }
  for (int i = 1; i < n; ++i) {
    int mx = getmx(i);
    update(1, 1, n, i, n - 1, a[i]);
    a[mx] += a[i];
    a[i] = 0;
  }
  for (int i = 1; i < n; ++i) {
    printf("%lld\n", query(1, 1, n, i));
  }
  return 0;
}
