#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long num[n], ps[n - 1];
  for (long long i = 0; i < n; i++) cin >> num[i];
  long long t = 1, temp = n - 1;
  while (temp) {
    temp /= 2;
    t *= 2;
  }
  t /= 2;
  ps[0] = num[0];
  for (long long i = 0; i < n - 1; i++) {
    if (i + 1 + t > n) t /= 2;
    if (i + 1 + t <= n && num[i] != 0) num[i + t] += num[i];
    if (i > 0 && i < n) ps[i] = num[i] + ps[i - 1];
  }
  for (long long i : ps) cout << i << "\n";
  return 0;
}
