#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
const int MODULO = 1000000007;
int n, a[100000];
int main() {
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i < (n - 1); i++) {
    int x = 1;
    while (i + x * 2 < n) x *= 2;
    a[i + x] += a[i];
    ans += a[i];
    a[i] = 0;
    cout << ans << endl;
  }
  return 0;
}
