#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T checkmin(T &a, T b) {
  return (a < b) ? a : a = b;
}
template <class T>
inline T checkmax(T &a, T b) {
  return (a > b) ? a : a = b;
}
template <class T>
T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (a == 0) ? b : GCD(b % a, a);
}
template <class T>
T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return (a == 0 || b == 0) ? 0 : a / GCD(a, b) * b;
}
namespace Poor {
const int MaxiN = 100005;
int N;
int A[MaxiN];
int Reply[MaxiN];
void Run() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) scanf("%d", A + i);
  for (int i = 0; i < N; ++i) {
    int Pos = i;
    for (int k = 17; k >= 0; --k)
      if (Pos + (1 << k) < N) {
        Reply[Pos] += A[i];
        Pos += (1 << k);
      }
  }
  long long Sum = 0;
  ios::sync_with_stdio(false);
  for (int i = 0; i < N - 1; ++i) {
    Sum += Reply[i];
    cout << Sum << endl;
  }
}
}  // namespace Poor
int main() {
  Poor::Run();
  return 0;
}
