#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
int main() {
  ios::sync_with_stdio(false);
  int n;
  static int a[N];
  scanf("%d", &n);
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  long long ans = 0;
  for (i = 0; i < n - 1; i++) {
    int max = n - 1 - i;
    int step;
    for (step = 1; step <= max; step <<= 1)
      ;
    step >>= 1;
    int aim = i + step;
    ans += a[i];
    a[aim] += a[i];
    a[i] = 0;
    cout << ans << endl;
  }
  return 0;
}
