#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  if (a > 0)
    return a;
  else
    return -a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
int main() {
  long long f, sum = 0, i, n, l = 0, k = 0, t;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sum = 0;
  for (i = 0; i < n - 1; i++) {
    t = (long long)(log2(n - 1 - i));
    a[(i + (long long)pow(2, t))] += a[i];
    sum += a[i];
    a[i] = 0;
    cout << sum << endl;
  }
  return 0;
}
