#include <bits/stdc++.h>
using namespace std;
long long n, arr[100000];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long del = 1 << (long long)floor(log2(n));
  long long ans = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (i + del >= n) del /= 2;
    ans += arr[i];
    arr[i + del] += arr[i];
    cout << ans << '\n';
  }
  return 0;
}
