#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
int a[MAX], n, r[MAX];
long long ans = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  r[1] = 1;
  for (int i = 2; i < n; i++) r[i] = r[i / 2] * 2;
  for (int i = 0; i < n - 1; i++) {
    a[i + r[n - i - 1]] += a[i];
    ans += a[i];
    cout << ans << ' ';
  }
}
