#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << '\n';
  err(++it, args...);
}
const long long N = 1e5 + 5, mod = 1e9 + 7, inf = 1e18 + 7;
long long a[N];
signed main() {
  long long n;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    if (i == n - 1) continue;
    if (a[i] > 0) {
      ans += a[i];
      long long j = i, k = 1;
      while (j + k < n) {
        k <<= 1;
      }
      j += k / 2;
      a[j] += a[i];
      a[i] = 0;
    }
    cout << ans << '\n';
  }
}
