#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.);
const long long inf = 10000000000000LL;
const int MAXN = 100000 + 13;
struct str {
  int n;
  str *next;
};
int main() {
  int n, a[MAXN], l;
  long long k = 0;
  cin >> n;
  l = 1;
  while (2 * l <= n) l *= 2;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) {
    k += a[i];
    if (i + l > n - 1) l /= 2;
    a[i + l] += a[i];
    a[i] = 0;
    cout << k << endl;
  }
  return 0;
}
