#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
long long n, a[N], dp[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++)
    for (int j = 20; ~j; j--)
      if (i + (1 << j) <= n) {
        dp[i] = dp[i - 1] + a[i];
        a[i + (1 << j)] += a[i];
        a[i] = 0;
        cout << dp[i] << ' ';
        break;
      }
  return 0;
}
