#include <bits/stdc++.h>
using namespace std;
int n;
long long a[111111];
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; ++i) cin >> a[i];
    long long cnt = 0, d = 1;
    while (d < n - 1) d *= 2;
    if (d > n - 1) d /= 2;
    for (int i = 0; i < n - 1; ++i) {
      cnt += a[i];
      if (i + d > n - 1) d /= 2;
      a[i + d] += a[i];
      a[i] = 0;
      cout << cnt << endl;
    }
  }
  return 0;
}
