#include <bits/stdc++.h>
using namespace std;
long long a[1000003];
long long ans;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  long long po;
  ans = 0;
  for (int i = 1; i < n; i++) {
    po = 1;
    while (i + po <= n) po *= 2;
    po /= 2;
    a[i + po] += a[i], ans += a[i];
    printf("%I64d\n", ans);
  }
  return 0;
}
