#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100005;
int num[MaxN];
int two[MaxN];
long long ans[MaxN];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < 20; ++i) {
    two[i] = (1 << i);
  }
  for (int i = 0; i < N; ++i) {
    scanf("%d", num + i);
  }
  for (int i = 0; i < N - 1; ++i) {
    if (i) ans[i] += ans[i - 1];
    if (!num[i]) continue;
    for (int j = 0; j < 20; ++j) {
      if (two[j] + i >= N) {
        ans[i] += num[i];
        num[i + two[j - 1]] += num[i];
        break;
      }
    }
  }
  for (int i = 0; i < N - 1; ++i) {
    printf("%I64d\n", ans[i]);
  }
}
