#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    int to = 1;
    while (i + (to << 1) < n) to <<= 1;
    ans += a[i];
    a[i + to] += a[i];
    a[i] = 0;
    cout << ans << '\n';
  }
  return 0;
}
