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