#include <bits/stdc++.h>
using namespace std;
int n, arr[100005];
int getIndex(int i) {
  int pwr;
  pwr = 1;
  while (i + pwr <= n) pwr <<= 1;
  return (pwr >> 1) + i;
}
int main() {
  int cnt;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &arr[i]);
  cnt = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (arr[i] >= 1) {
      arr[getIndex(i)] += arr[i];
      cnt += arr[i];
      arr[i] = 0;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
