#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n], ans[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] != 0) {
      int b = 1;
      while (b + i < n) {
        b *= 2;
      }
      b /= 2;
      b += i;
      a[b] += a[i];
    }
    if (i == 0)
      ans[i] = a[i];
    else
      ans[i] = ans[i - 1] + a[i];
  }
  for (int i = 0; i < n - 1; i++) cout << ans[i] << "\n";
}
