#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using ull = unsigned long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  int st = 20;
  while ((1 << st) >= n) st--;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    int p;
    cin >> p;
    a[i] += p;
    ans += a[i];
    cout << ans << endl;
    while (i + (1 << st) >= n) st--;
    a[i + (1 << st)] += a[i];
  }
  return 0;
}
