#include <bits/stdc++.h>
using namespace std;
bool cmp(const long long& a, const long long& b) { return a > b; }
int a[1000005], Left[1000005], Right[1000005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  int res = 0;
  for (int i = (1); i <= (n - 1); ++i) {
    int left = 0;
    int right = 18;
    while (left < right - 1) {
      int mid = (left + right) / 2;
      if ((1 << mid) + i <= n)
        left = mid;
      else
        right = mid;
    }
    a[(1 << left) + i] += a[i];
    res += a[i];
    printf("%d\n", res);
  }
  return 0;
}
