#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, k = 1, result = 0;
  cin >> n;
  for (; k << 1 < n; k <<= 1)
    ;
  vector<unsigned long long> a(n);
  for (unsigned long long i = 0; i < n; cin >> a[i++])
    ;
  for (unsigned long long i = 0; i < n - 1; a[i + k] += a[i],
                          cout << (result += a[i]) << endl,
                          k >>= (k == n - i - 1 ? 1 : 0), ++i)
    ;
  return 0;
}
