#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 20;
const double PI = M_PI;
const double EPS = 1e-15;
const int MaxN = 100005;
int n;
long long a[MaxN];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long answer = 0;
  for (int k = 1; k < n; k++) {
    int j = 1;
    while (k + j <= n) j = 2 * j;
    j = j / 2;
    answer += a[k];
    a[k + j] += a[k];
    cout << answer << endl;
  }
  return 0;
}
