#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int& i : a) cin >> i;
  long long int ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    int j = 0;
    while (i + (1 << (j + 1)) < n) ++j;
    if (a[i] != 0) {
      a[i + (1 << (j))] += a[i];
      ans += a[i];
      a[i] = 0;
    }
    cout << ans << '\n';
  }
  return 0;
}
