#include <bits/stdc++.h>
using namespace std;
int n, t, a, b, c, Pow2[100];
int arr[100000 + 5];
long long res;
void Gen() {
  int m = 1;
  Pow2[0] = 1;
  for (int i = 1;; i++) {
    Pow2[i] = Pow2[i - 1] * 2;
    if (Pow2[i] > 100000) {
      t = i - 1;
      break;
    }
  }
}
int findi(int k) {
  for (int i = (t), _b = (0); i >= _b; i--) {
    if (k + Pow2[i] <= n) return k + Pow2[i];
  }
}
void solve() {
  res = 0;
  for (int k = (1), _b = (n - 1); k <= _b; k++) {
    res += arr[k];
    cout << res << endl;
    while (arr[k] > 0) {
      int tmp = findi(k);
      arr[tmp] += arr[k];
      arr[k] = 0;
    }
  }
}
int main() {
  Gen();
  scanf("%d", &n);
  for (int i = (1), _b = (n); i <= _b; i++) scanf("%d", &arr[i]);
  solve();
  return 0;
}
