#include <bits/stdc++.h>
using namespace std;
const long long int m = pow(10, 9) + 7;
int a[100005];
int b[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  b[1] = 1;
  for (int i = 2; i < n; i++) {
    b[i] = b[i / 2] * 2;
  }
  for (int i = 0; i < n - 1; i++) {
    a[i + b[n - 1 - i]] += a[i];
    ans += a[i];
    cout << ans << "\n";
  }
  return 0;
}
