#include <bits/stdc++.h>
using namespace std;
const int maxn = int(1e5) + 10;
int a[maxn];
long long moves[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  moves[0] = 0;
  for (int i = 0; i < n - 1; i++) {
    int pos = 1 << (int)floor(log(n - i - 1) / log(2));
    moves[i + 1] = a[i] + moves[i];
    a[i + pos] += a[i];
    a[i] = 0;
  }
  for (int k = 1; k < n; k++) cout << moves[k] << '\n';
  return 0;
}
