#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
void sIO();
int n, cx, kk;
long long ans, a[111111];
int main() {
  sIO();
  scanf("%d", &n);
  cx = 1;
  while (cx < n) cx <<= 1;
  cx >>= 1;
  ans = 0;
  kk = n - 1;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < kk; ++i) {
    if (i + cx >= n) cx >>= 1;
    a[i + cx] += a[i];
    ans += a[i];
    printf("%I64d\n", ans);
  }
  return 0;
}
void sIO() {}
