#include <bits/stdc++.h>
using namespace std;
long long n, arr[100003], pot[30], ans[100002];
void power() {
  pot[0] = 1;
  for (int i = 1; i < 29; i++) {
    pot[i] = pot[i - 1] * 2;
  }
}
long long step(long long x) {
  long long p = 1;
  for (int i = 1; x + p <= n; i++) {
    p = pot[i];
  }
  return p / 2;
}
int main() {
  power();
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &arr[i]);
  }
  for (int i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + arr[i];
    arr[i + step(i)] += arr[i];
    printf("%lld\n", ans[i]);
  }
  return 0;
}
