#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n + 1];
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i)) cin >> a[i];
  int res = 0;
  for (int(i) = (int)(1); (i) <= (int)(n - 1); ++(i)) {
    int pw = 1;
    while (i + (pw << 1) <= n) pw <<= 1;
    res += a[i];
    cout << res << '\n';
    a[i + pw] += a[i];
    a[i] = 0;
  }
  return 0;
}
