#include <bits/stdc++.h>
using namespace std;
int N;
long long A[114514];
int main() {
  scanf("%d", &N);
  for (int(i) = 0; (i) < (N); (i)++) scanf("%I64d", &A[i]);
  long long res = 0;
  int w = 1 << 17;
  for (int(i) = 0; (i) < (N - 1); (i)++) {
    while ((N - 1 - i) < w) w /= 2;
    res += A[i];
    printf("%I64d\n", res);
    A[i + w] += A[i];
  }
}
