#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int a[N];
vector<int> b[N];
int main() {
  int n;
  long long ret = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n - 1; ++i) {
    b[i].push_back(i);
    int j;
    for (j = 0; i + (1 << j) < n; ++j)
      ;
    --j;
    for (int k = 0; k < (int)(b[i].size()); ++k) {
      b[i + (1 << j)].push_back(b[i][k]);
      ret += a[b[i][k]];
    }
    printf("%I64d\n", ret);
  }
  return 0;
}
