#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 100100;
int n, a[MAXN], b[MAXN];
int main() {
  cin >> n;
  for (int i = 0; i < (int)(n); i++) scanf("%d", &a[i]);
  for (int i = 0; i < (int)(n + 1); i++)
    for (int j = 0; j < (int)(30); j++)
      if ((i & (1 << j)) != 0) b[i]++;
  for (int k = 1; k < n; k++) {
    int ans = 0;
    for (int i = 0; i < (int)(k); i++) {
      int cur = INF;
      for (int j = k; j < n; j++) cur = min(cur, b[j - i] * a[i]);
      ans += cur;
    }
    cout << ans << endl;
  }
  return 0;
}
