#include <bits/stdc++.h>
using namespace std;
int read();
void write(long long x);
int arr[112345];
int main() {
  int n = read();
  long long ans = 0;
  for (int i = 1; i < n; ++i) {
    int tmp = read();
    arr[i] += tmp;
    int t = 0;
    while ((1 << (t + 1)) <= n - i) ++t;
    ans += arr[i];
    arr[i + (1 << t)] += arr[i];
    write(ans);
    putchar('\n');
  }
  return 0;
}
int read() {
  int x = 0;
  int sign = 0;
  int c = getchar();
  for (; !isdigit(c); c = getchar()) {
    sign |= c == '-';
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  return sign ? -x : x;
}
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x / 10) {
    write(x / 10);
  }
  putchar(x % 10 + '0');
}
