#include <bits/stdc++.h>
int a, sum;
int b[100009];
int z[19];
int main() {
  scanf("%d", &a);
  for (int i = 0; i < a; i++) scanf("%d", &b[i]);
  z[0] = 1;
  for (int i = 1; i < 17; i++) z[i] = z[i - 1] * 2;
  for (int i = 0; i < a - 1; i++) {
    for (int j = 16; j >= 0; j--)
      if (i + z[j] < a) {
        b[i + z[j]] += b[i];
        sum += b[i];
        b[i] = 0;
      }
    printf("%d\n", sum);
  }
  getchar();
}
