#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1, 0};
const int dy[] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
const int inf = 1 << 30;
long long a[100500], sum;
int i, n, t;
int main() {
  srand(time(0));
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%I64d", a + i);
  for (i = 1; i < n; i++) {
    for (t = 0; i + (1 << t) <= n; t++)
      ;
    t--;
    a[i + (1 << t)] += a[i];
    sum += a[i];
    printf("%I64d\n", sum);
  }
  return 0;
}
