#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n, cur = 1;
long long a[N], ans[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  while (cur * 2 < n) cur *= 2;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n - 1; i++) {
    while (i + cur > n) cur /= 2;
    a[i + cur] += a[i];
    ans[i] = ans[i - 1] + a[i];
    a[i] = 0;
    cout << ans[i] << "\n";
  }
  return 0;
}
