#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> input;
  for (int a = 0; a < n; a++) {
    int p;
    cin >> p;
    input.push_back(p);
  }
  long long counting = 0;
  for (int a = 0; a < n - 1; a++) {
    int k = input[a];
    int r;
    for (r = 1; a + r < n; r *= 2)
      ;
    r /= 2;
    input[a + r] += input[a];
    counting += (long long)input[a];
    input[a] = 0;
    cout << counting << endl;
  }
  return 0;
}
