#include <bits/stdc++.h>
using namespace std;
int a[100009], bin[20] = {1};
int main() {
  int i, j, n;
  long long ans;
  for (i = 1; i < 20; i++) bin[i] = bin[i - 1] << 1;
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    for (i = 0; i < n; i++) scanf("%d", a + i);
    for (i = 0; i + 1 < n; i++) {
      j = 0;
      while (i + bin[j + 1] < n) j++;
      ans += a[i];
      a[i + bin[j]] += a[i];
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
