#include <bits/stdc++.h>
using namespace std;
const int maxN = 1E5 + 10;
long long int a[maxN], otp;
int32_t main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) {
    int x = log2(n - i - 1);
    otp += a[i];
    a[i + (1 << x)] += a[i];
    cout << otp << "\n";
  }
  return 0;
}
