#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100007;
long long i, j, k, n, m, t, x, y, ans;
long long pw2[32];
long long a[MAXN];
void calPowerTwo() {
  long long i, j, k;
  pw2[0] = 1;
  for (i = 1; i < 32; i++) {
    pw2[i] = pw2[i - 1] * 2;
  }
}
int main() {
  calPowerTwo();
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    ans = 0;
    for (i = 0; i < n - 1; i++) {
      ans += a[i];
      k = 0;
      while (i + pw2[k] < n) {
        k++;
      }
      k--;
      a[i + pw2[k]] += a[i];
      a[i] = 0;
      cout << ans << endl;
    }
  }
  return 0;
}
