#include <bits/stdc++.h>
using namespace std;
int getMaxIndex(int i, int n) {
  int t = 0;
  int s = n - i;
  while (s > 1) {
    t++;
    s /= 2;
  }
  while (pow(2, t) + i > n) t--;
  return pow(2, t) + i;
}
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n + 1);
  for (int i = 1; i <= n; ++i) cin >> arr[i];
  int cnt = 0;
  for (int i = 1; i < n; ++i) {
    int maxIndex = getMaxIndex(i, n);
    cnt += arr[i];
    arr[maxIndex] += arr[i];
    arr[i] = 0;
    cout << cnt << endl;
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
