#include <bits/stdc++.h>
using namespace std;
int testCase;
string s;
int iinf = 1e9 + 1;
long long inf = 1e16 + 1;
void solve() {
  long long n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  ;
  long long t, c = 0;
  for (int i = 0; i < n - 1; i++) {
    t = log2(n - i - 1);
    c += arr[i];
    arr[i + pow(2, t)] += arr[i];
    cout << c << "\n";
  }
}
int main() {
  testCase = 1;
  while (testCase--) {
    solve();
    cout << "\n";
  }
}
