#include <bits/stdc++.h>
using namespace std;
bool SR(int &x) { return scanf("%d", &x) == 1; }
bool SR(long long &x) { return scanf("%lld", &x) == 1; }
bool SR(double &x) { return scanf("%lf", &x) == 1; }
bool SR(char *s) { return scanf("%s", s) == 1; }
bool RI() { return true; }
template <typename I, typename... T>
bool RI(I &x, T &...tail) {
  return SR(x) && RI(tail...);
}
void SP(const int x) { printf("%d", x); }
void SP(const long long x) { printf("%lld", x); }
void SP(const double x) { printf("%.16lf", x); }
void SP(const char *s) { printf("%s", s); }
void PL() { puts(""); }
template <typename I, typename... T>
void PL(const I x, const T... tail) {
  SP(x);
  if (sizeof...(tail)) putchar(' ');
  PL(tail...);
}
const int maxn = 1e5 + 5;
int n, a[maxn];
void read() {
  RI(n);
  for (int i = (1); i <= int(n); i++) RI(a[i]);
}
inline int count(const int &x) { return __builtin_popcount(x); }
vector<int> mov[maxn];
void build() {
  for (int i = (1); i <= int(n - 1); i++) {
    vector<int> &v = mov[i];
    for (int j = n - i; j; j -= j & -j) v.push_back(j);
    reverse((v).begin(), (v).end());
  }
}
inline int det(const pair<int, int> &x) {
  return mov[x.first][x.second] + x.first;
}
inline long long cost(const pair<int, int> &x) {
  return 1LL * a[x.first] * count(mov[x.first][x.second]);
}
long long s[maxn];
void sol() {
  for (int i = (1); i <= int(n - 1); i++) {
    s[i] += 1LL * a[i] * count(mov[i][0]);
    for (int j = 0; j < int(((int)(mov[i]).size()) - 1); j++)
      s[i + mov[i][j]] +=
          1LL * a[i] * (count(mov[i][j + 1]) - count(mov[i][j]));
  }
  for (int i = 0; i < int(n); i++) s[i + 1] += s[i];
  for (int i = (1); i <= int(n - 1); i++) PL(s[i]);
}
int main() {
  read();
  build();
  sol();
  return 0;
}
