#include <bits/stdc++.h>
using namespace std;
const long long N = 150;
void read() {
  freopen("revegetate.in", "r", stdin);
  freopen("revegetate.out", "w", stdout);
}
long long us[N], ok[5];
void Solve() {
  long long n, m;
  cin >> n;
  m = n;
  vector<long long> v(n + 1);
  for (int i = 1; i <= n; ++i) cin >> v[i];
  long long a = -1;
  while (m > 0) m /= 2, a++;
  long long res = 0;
  for (int i = 1; i <= n - 1; ++i) {
    long long mn = 1e9, c = -1;
    if (!v[i]) {
      cout << res << '\n';
      continue;
    }
    for (int j = 0; j <= a; ++j) {
      if (i + pow(2, j) == n) {
        res += v[i];
        c = -3;
        break;
      }
    }
    if (c == -3) {
      cout << res << '\n';
      continue;
    }
    for (int j = a; j >= 0; --j) {
      if (i + pow(2, j) <= n) {
        c = j;
        break;
      }
    }
    if (c >= 0) {
      res += v[i];
      v[i + pow(2, c)] += v[i];
    }
    cout << res << '\n';
  }
  for (int i = 1; i <= n; ++i) {
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long T = 1;
  while (T--) {
    Solve();
    cout << '\n';
  }
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}
