#include <bits/stdc++.h>
using namespace std;
int n, a[100001];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    int t = 0;
    for (int j = 20; j >= 0; --j)
      if (i + (1 << j) < n) {
        sum += a[i];
        a[i + (1 << j)] += a[i];
        break;
      }
    cout << sum << endl;
  }
  return 0;
}
