#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int maxn = 200005;
const int mod = 1000000007;
void task() {
  long long n;
  cin >> n;
  std::vector<long long> a(n + 1), ans(n + 1, 0);
  long long now = 1;
  while (now * 2 < n) now *= 2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    while (i + now > n) now /= 2;
    a[i + now] += a[i];
    ans[i] = a[i] + ans[i - 1];
    a[i] = 0;
    cout << ans[i] << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  for (int __ = 1; __ <= T; __++) {
    task();
  }
  return 0;
}
