#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const long long LINF = 4000000000000000000LL;
const double eps = 1e-9;
void prepare() {}
void panic(bool expression = false) {
  if (!expression) {
    cerr << "PANIC!" << endl;
    assert(false);
  }
}
void solve(int test_num) {
  int n;
  scanf("%d", &n);
  vector<long long> a(n * 2 + 1);
  for (int i = (1); i < (n + 1); i++) scanf("%I64d", &a[i]);
  long long res = 0;
  for (int i = (1); i < (n); i++) {
    if (a[i] > 0) {
      res += a[i];
      for (int j = (1); j < (100); j++) {
        if (i + (1 << j) > n) {
          a[i + (1 << (j - 1))] += a[i];
          break;
        }
      }
    }
    printf("%I64d\n", res);
  }
}
int main() {
  prepare();
  solve(0);
  return 0;
}
