#include <bits/stdc++.h>
using namespace std;
int N, x;
int v[100009];
int d[100009];
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> v[i];
    d[i] = v[i];
  }
  for (int i = 1; i < N; i++) {
    x = 1;
    while (i + x <= N) x *= 2;
    x /= 2;
    d[i + x] += d[i];
  }
  x = 0;
  for (int i = 1; i < N; i++) {
    x += d[i];
    cout << x << "\n";
  }
  return 0;
}
