#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T Max(T a, T b) {
  if (a > b)
    return a;
  else
    return b;
}
template <class T>
inline T Min(T a, T b) {
  if (a < b)
    return a;
  else
    return b;
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T TripleMax(T a, T b, T c) {
  return Max(Max(a, b), c);
}
template <class T>
inline T TripleMin(T a, T b, T c) {
  return Min(Min(a, b), c);
}
long long a[100005];
long long n;
long long maxt;
double temp;
long long tol;
int main(int argc, const char* argv[]) {
  cin >> n;
  for (int(i) = (1); (i) < (n + 1); (i)++) {
    cin >> a[i];
  }
  tol = 0;
  for (int(i) = (1); (i) < (n); (i)++) {
    temp = log(n - i) / log(2);
    maxt = floor(temp);
    maxt = pow(2, maxt);
    tol = tol + a[i];
    a[i + maxt] += a[i];
    a[i] = 0;
    cout << tol << endl;
  }
  return 0;
}
