#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (auto &in : v) cin >> in;
  long long ind, sum = 0;
  for (long long i = 0; i < n - 1; i++) {
    ind = (long long)log2(n - i - 1);
    ind = pow(2, ind);
    v[ind + i] += v[i];
    sum += v[i];
    cout << sum << endl;
  }
}
