#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const long long linf = 9000000000000000000LL;
const double finf = 1.0e18;
const double eps = 1.0e-8;
int n, a[100005], p[25];
long long A[100005], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    A[i] = a[i];
  }
  p[0] = 1;
  for (int i = 1; i <= 20; i++) p[i] = p[i - 1] << 1;
  ans = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 0;; j++) {
      if (i + p[j + 1] > n) {
        ans += A[i];
        A[i + p[j]] += A[i];
        A[i] = 0;
        break;
      }
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
