#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long arr[100001];
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &arr[i]);
  }
  long long ans = 0;
  for (int i = 0; i < n - 1; i++) {
    ans += arr[i];
    printf("%I64d\n", ans);
    int temp = log10(n - i - 1) / log10(2);
    arr[i + (int)pow(2, temp)] += arr[i];
    arr[i] = 0;
  }
  return 0;
}
