#include <bits/stdc++.h>
using namespace std;
template <typename T>
T debug(string s, T x, string d) {
  int16_t p;
  while ((p = s.find("dbg(")) != string::npos) {
    s.erase(p, 4);
    int16_t l = 1;
    do {
      p++;
      if (s[p] == '(') l++;
      if (s[p] == ')') l--;
    } while (l != 0 || s[p] != ')');
    s.erase(p, 1);
  }
  cout << s << " = " << x << d;
  return x;
}
inline int64_t max2(int64_t a, int64_t b) { return a > b ? a : b; }
inline int64_t max3(int64_t a, int64_t b, int64_t c) {
  return a > b ? a > c ? a : c : b > c ? b : c;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int32_t n;
  cin >> n;
  vector<int32_t> a(n);
  for (auto i = a.begin(); i != a.end(); i++) cin >> *i;
  int32_t t = 1;
  while (n > 2 * t) t *= 2;
  int64_t ans = 0;
  for (auto i = 0; i <= n - 2; i++) {
    ans += a[i];
    cout << (ans) << '\n';
    if (i + t == n) t /= 2;
    a[i + t] += a[i];
  }
  cerr << clock() * 1000 / CLOCKS_PER_SEC << " ms\n";
}
