#include <bits/stdc++.h>
int main() {
  int n, a[100000], m, o, i, j, k;
  long long s[100000] = {};
  scanf("%d", &n);
  for (i = 0; i < n; ++i) scanf("%d", a + i);
  for (i = 1; i < n; ++i) {
    k = n - i - 1;
    m = i;
    while (m != (m & -m)) {
      m ^= (m & -m);
      s[n - 1] += a[k];
    }
    s[n - 1] += a[k];
  }
  for (i = 2, o = 2; i < n; i == (i & -i) ? o <<= 1 : 0, ++i) {
    k = n - i;
    s[k] = s[k + 1] - a[k];
    for (j = 1; k - j * o >= 0; ++j) s[k] -= a[k - j * o];
  }
  for (i = 1; i < n; ++i) printf("%I64d\n", s[i]);
  scanf(" ");
  return 0;
}
