#include <bits/stdc++.h>
void print(int a[], int n);
void copy(int src[], int des[], int n);
int main(void) {
  int n;
  int a[100001];
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  int t, d;
  int moves = 0;
  for (int i = 1; i < n; ++i) {
    t = log2(n - i);
    d = i + (1 << t);
    moves += a[i];
    a[d] += a[i];
    printf("%d\n", moves);
  }
  return 0;
}
