#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e6 + 5;
long long a[maxn], b[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long sum = 0;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i < n; i++) {
    long long p = 1;
    while (i + p <= n) p *= 2;
    sum += a[i];
    cout << sum << endl;
    a[i + p / 2] += a[i];
  }
  return 0;
}
