#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
signed long long n, st = 1, ans = 0;
signed long long a[100100];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  while (st <= n) st *= 2;
  for (int i = 1; i < n; i++) {
    ans += a[i];
    cout << ans << endl;
    while (i + st > n) st /= 2;
    a[i + st] += a[i];
  }
  return 0;
}
