#include <bits/stdc++.h>
using namespace std;
int a[100010];
long long b[100010];
long long ans[100010];
long long x, y, p;
int main() {
  int n;
  cin >> n;
  y = 1;
  while (y < n) y *= 2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p = i;
    x = y;
    while (p < n && x > 0) {
      if (p + x < n) {
        b[p] += a[i];
        p += x;
      } else
        x /= 2;
    }
  }
  ans[0] = b[0];
  cout << ans[0] << endl;
  for (int i = 1; i < n - 1; i++) {
    ans[i] = ans[i - 1] + b[i];
    cout << ans[i] << endl;
  }
  scanf(" ");
}
