#include <bits/stdc++.h>
using namespace std;
int pow(int a, int b) {
  int ans = 1;
  for (int i = 0; i < b; i++) {
    ans = ans * a;
  }
  return ans;
}
int main(int argc, char const *argv[]) {
  for (int I = 0; I < 1; I++) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v.push_back(a);
    }
    int t = 0;
    for (int i = 0; i < n - 1; i++) {
      if (v[i] == 0) {
        cout << t << endl;
        continue;
      }
      int diff = n - i - 1;
      int temp;
      for (int j = 0; j < diff; j++) {
        if (diff == pow(2, j)) {
          temp = i + pow(2, j);
          break;
        } else if (diff < pow(2, j)) {
          temp = i + pow(2, j - 1);
          break;
        }
      }
      t = t + v[i];
      v[temp] += v[i];
      v[i] = 0;
      cout << t << endl;
    }
  }
  return 0;
}
