#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[100005], ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    int t = 1;
    while (i + t <= n) t = t * 2;
    t = t / 2;
    ans = ans + a[i];
    a[i + t] = a[i + t] + a[i];
    cout << ans << endl;
  }
  return 0;
}
