#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n = 4, x = 0, j = 0, i = 0;
  cin >> n;
  long long int arr[n + 1], ans[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    ans[i] = 0;
  }
  for (i = 1; i <= n; i++) {
    ans[i - 1] = arr[i - 1];
    if (arr[i - 1] == 0) continue;
    j = 0;
    while ((i + (1 << j)) <= n) {
      x = i + (1 << j);
      j++;
    }
    if (false) {
      cout << "x"
           << " = " << x << ' ';
      ;
    }
    ans[i - 1] = arr[i - 1];
    arr[x - 1] += arr[i - 1];
  }
  for (int i = 1; i < n; i++) ans[i] += ans[i - 1];
  for (int i = 0; i < n - 1; i++) cout << ans[i] << "\n";
  return 0;
}
