#include <bits/stdc++.h>
int arr[100000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  long long tot = 0;
  for (int k = 1; k < n; k++) {
    tot += arr[k - 1];
    long long p = 1;
    while (p <= n - k) p <<= 1;
    for (long long j = k - p - 1; j >= 0; j -= p) tot += arr[j];
    printf("%I64d\n", tot);
  }
  return 0;
}
