#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, maxm = (1 << 17), mod = 1e9 + 7, hash = 1239;
const double PI = 3.14159265359;
long long a[maxn];
int main() {
  ios::sync_with_stdio(0);
  long long n, b, ans = 0, p = 1;
  cin >> n;
  while (p <= n) p *= 2;
  for (int i = 1; i < n; i++) {
    cin >> b;
    while (i + p > n) p /= 2;
    ans += a[i] + b;
    a[i + p] += a[i] + b;
    cout << ans << endl;
  }
  return 0;
}
