#include <bits/stdc++.h>
using namespace std;
int n, arr[100000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  long long steps = 0;
  for (int i = 0; i < n - 1; i++) {
    int x = 1;
    while (x * 2 + i < n) x *= 2;
    steps += arr[i];
    arr[i + x] += arr[i];
    cout << steps << endl;
  }
  return 0;
}
