#include <bits/stdc++.h>
using namespace std;
long long a[100000 + 123];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int ta;
    scanf("%d", &ta);
    a[i] = ta + 0ll;
  }
  for (int i = 0; i < n - 1; ++i) {
    int j;
    for (j = 0; j <= 20; ++j)
      if ((i + (1 << j)) >= n) break;
    a[i + (1 << (j - 1))] += a[i];
  }
  long long summ = 0;
  for (int i = 0; i < n - 1; ++i) {
    summ += a[i];
    cout << summ << endl;
  }
  return 0;
}
