#include <bits/stdc++.h>
const int N = 101010;
int n, i, a[N], ans[N], j;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i < n; i++) {
    ans[i] = ans[i - 1];
    for (j = 0; i + (1 << j) <= n; j++)
      ;
    j--;
    ans[i] += a[i];
    a[i + (1 << j)] += a[i];
  }
  for (i = 1; i < n; i++) printf("%d\n", ans[i]);
}
