#include <bits/stdc++.h>
using namespace std;
long long a[114514];
int main() {
  long long n, cnt = 0;
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < n - 1; i++) {
    int f = 20;
    while ((1 << f) + i >= n) f--;
    cnt += a[i], a[i + (1 << f)] += a[i];
    printf("%lld", cnt);
    puts("");
  }
}
