#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b != 0 ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
long long Pow(long long n, long long e) {
  if (e == 0) return 1;
  if (e == 1)
    return n;
  else if (e & 1) {
    long long t = Pow(n, e / 2);
    return n * t * t;
  } else {
    long long t = Pow(n, e / 2);
    return t * t;
  }
}
long long v[1000005];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0, max_ = (N); i < max_; ++i) scanf("%I64d", &v[i]);
  long long n = 1;
  vector<long long> powerTwo;
  for (int i = 0, max_ = (33); i < max_; ++i) {
    powerTwo.push_back(n);
    n *= 2;
  }
  long long step = 0;
  for (int i = 0, max_ = (N - 1); i < max_; ++i) {
    auto iter = lower_bound((powerTwo).begin(), (powerTwo).end(), N - i - 1);
    if (*iter > N - i - 1) --iter;
    int next = i + *iter;
    v[next] += v[i];
    step += v[i];
    printf("%I64d\n", step);
  }
  return 0;
}
