Building a Fenwick Tree#8247

Building a Fenwick Tree

1 second
64 megabytes
Very easy (≈850)

You are given an array of natural numbers. Your task is to construct a Fenwick tree (also known as a Binary Indexed Tree) and, after each addition of an element to the tree, output the current state of the internal array used by the Fenwick tree implementation.

Input

The first line contains an integer (1 \leq n \leq 100) — the size of the array. The second line contains natural numbers, the elements of the array (1 \leq A_i \leq 10^9).

Output

Output lines. In each line, print numbers — the state of the internal array of the Fenwick tree after adding the corresponding element of to the tree.

Examples

Example 1

Loading
Loading