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