#include <bits/stdc++.h>
using namespace std;
int a[100100], b[100100], n, ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int c = 1;
  while (c <= n) c = c << 1;
  for (int i = 1; i <= n - 1; ++i) {
    int cc = c;
    while (i + cc > n) cc = cc >> 1;
    b[i] = cc;
  }
  for (int i = 1; i <= n - 1; ++i) {
    ans += a[i];
    a[i + b[i]] += a[i];
    printf("%d\n", ans);
  }
  return 0;
}
