#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, a[maxn];
vector<int> J[maxn];
int lowbit(int x) {
  for (int i = 30; i >= 0; --i) {
    if (x + (1 << i) <= n) return (1 << i);
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    J[i + lowbit(i)].push_back(a[i]);
  }
  long long ans = a[1];
  for (int i = 2; i <= n; ++i) {
    printf("%I64d\n", ans);
    ans += a[i];
    if (i != n) {
      int size = J[i].size();
      for (int j = 0; j < size; ++j) {
        J[i + lowbit(i)].push_back(J[i][j]);
        ans += J[i][j];
      }
    }
  }
  return 0;
}
