#include <bits/stdc++.h>
int n;
int a[100055];
int Highbit(int x) {
  int k = (int)log2(x);
  return int(pow(2, k));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n - 1; i++) {
    ans += a[i];
    printf("%d\n", ans);
    int pre = Highbit(n - i);
    a[i + pre] += a[i];
  }
}
