#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
int n, a[maxn];
long long ans = 0;
int main(void) {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  for (int i = 0; i < (n - 1); ++i) {
    int c = 0;
    while (i + (1 << c) < n) ++c;
    --c;
    ans += a[i];
    a[i + (1 << c)] += a[i];
    a[i] = 0;
    cout << ans << endl;
  }
  return 0;
}
