#include <bits/stdc++.h>
using namespace std;
const int maxn = 100011;
int n;
long long a[maxn];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  ;
  long long sum = 0;
  for (int i = 0; i < n - 1; i++) {
    int t = 0;
    while (i + pow((float)2, t) < n) t++;
    a[i + (int)pow((float)2, t - 1)] += a[i];
    sum += a[i];
    cout << sum << "\n";
  }
}
