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