#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
const double PI = 2 * acos(0.0);
const double EPS = 1e-8;
const int INF = (1 << 30) - 1;
int n;
long long a[100000];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int r;
    cin >> r;
    a[i] = r;
  }
  long long ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i]) {
      int l = 1 << 17;
      while (i + l >= n) l >>= 1;
      ans += a[i];
      a[i + l] += a[i];
    }
    printf("%I64d\n", ans);
  }
  return 0;
};
