#include <bits/stdc++.h>
using namespace std;
long long n, a[100100], b[100100];
int main() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  for (long long i = 1, t; i < n; ++i) {
    t = 1;
    while (t <= n - i) t <<= 1;
    t >>= 1;
    b[i] = b[i - 1] + a[i];
    a[i + t] += a[i];
  }
  for (long long i = 1; i < n; ++i) cout << b[i] << "\n";
  return 0;
}
