#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)(t.size()))); ++(i)) s << t[i] << " ";
  return s;
}
int a[100007];
int main() {
  int(n);
  scanf("%d", &(n));
  for (int(i) = 1; (i) <= (n); ++(i)) scanf("%d", a + i);
  long long res = 0;
  for (int(k) = (1); (k) <= (n - 1); ++k) {
    int odl = 1;
    while (k + odl <= n) odl *= 2;
    odl /= 2;
    a[k + odl] += a[k];
    res += a[k];
    printf("%I64d\n", res);
  }
}
