#include <bits/stdc++.h>
using namespace std;
template <class T>
int popcount(T n);
template <>
int popcount(unsigned int n) {
  return n ? __builtin_popcount(n) : 0;
}
template <>
int popcount(int n) {
  return n ? __builtin_popcount(n) : 0;
}
template <>
int popcount(unsigned long long n) {
  return n ? __builtin_popcountll(n) : 0;
}
template <>
int popcount(long long n) {
  return n ? __builtin_popcountll(n) : 0;
}
template <class T>
void max_swap(T& a, const T& b) {
  a = max(a, b);
}
template <class T>
void min_swap(T& a, const T& b) {
  a = min(a, b);
}
const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
bool valid_pos(int x, int y, int w, int h) {
  return 0 <= x && x < w && 0 <= y && y < h;
}
template <class T>
void print(T a, int n, int br = 1, const string& deli = ", ") {
  cout << "{ ";
  for (int i = 0; i < n; ++i) {
    cout << a[i];
    if (i + 1 != n) cout << deli;
  }
  cout << " }";
  while (br--) cout << endl;
}
template <class T>
void print(const vector<T>& v, int br = 1, const string& deli = ", ") {
  print(v, v.size(), br, deli);
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  static long long a[114514];
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long long res = 0;
  for (int i = 1; i < n; ++i) {
    int t = 1;
    while (i + 2 * t <= n) t <<= 1;
    res += a[i];
    a[i + t] += a[i];
    cout << res << endl;
  }
}
