#include <bits/stdc++.h>
long long DP[100010], newv[100010];
int value[100010];
int mpow(int value, int exp) {
  if (exp == 0) return 1;
  if (exp == 1) return value;
  int res = mpow(value, exp / 2);
  res *= res;
  if (exp % 2 != 0) return value * res;
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &value[i]);
  for (int i = 1; i < n; i++) {
    int pot = 0;
    while (i + mpow(2, pot) <= n) pot++;
    pot--;
    DP[i] = value[i] + DP[i - 1] + newv[i];
    newv[i + mpow(2, pot)] += value[i] + newv[i];
  }
  for (int i = 1; i < n; i++) printf("%I64d\n", DP[i]);
  return 0;
}
