#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int CASE = 1;
const int mxn = 1e5 + 1;
const long long INF = 1e18;
bool prime(int n) {
  if (n <= 1) return false;
  if (n == 2 or n == 3) return true;
  if (n % 2 == 0 or n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long __gcd(long long a, long long b) { return !b ? a : __gcd(b, a % b); }
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  long long ans = 0;
  for (long long i = 0; i < n - 1; i++) {
    int pow = 1;
    while (i + (pow << 1) < n) pow <<= 1;
    ans += v[i];
    v[i + pow] += v[i];
    v[i] = 0;
    cout << ans << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
