#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000009;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int MAXN = 0;
const int MAXM = 0;
long long a[100003];
int i, j, k, n;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (i = 0; i < n - 1; i++) {
    for (k = 0; k < 30; k++) {
      if (i + (1 << k) >= n) break;
    }
    k--;
    ans += a[i];
    cout << ans << endl;
    a[i + (1 << k)] += a[i];
  }
  return 0;
}
