Zombie Invasion

No attempts yetTime limit2sMemory limit128 MB

Problem

A group of survivors lands by helicopter on an isolated island. The island is a long narrow strip with 20 villages in a single row, running from the west coast to the east coast. One survivor was already infected and came ashore at the easternmost village, the locals there caught it, and zombies now push west from the east coast. The islanders start running west.

The islanders travel in a peculiar way. Only a pair may cross between two villages, and of every pair that crosses, just one arrives alive.

The zombies overrun the villages one at a time starting from the eastern end, so the moves also happen one village at a time from east to west. When a village's turn comes and it holds kk people, k/2\lfloor k/2 \rfloor of them arrive in the village immediately to the west, and if kk is odd the leftover person stays behind. A village holding a single person cannot form a pair, so nobody there moves. Anyone who reaches the west coast village stops and gathers there.

Report how many islanders stay in each village and how many end up in the village on the west coast.

Input

The first line has the number of data sets NN. (1N501 \le N \le 50)

Each of the next NN lines has twenty non-negative integers. Each integer is the number of islanders living in one village and is at most 1000. The leftmost integer is the village on the west coast and the rightmost integer is the village on the east coast.

Output

For each data set, print twenty non-negative integers on one line, separated by single spaces.

The first number is how many people are in the west coast village once every move is done, counting the people who already lived there. The remaining numbers are how many people stayed behind in each village, from the second village from the west through to the village on the east coast.