Problem1576--Tetris

1576: Tetris

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

In the game of Tetris, when a row is filled with blocks, those blocks disappear and points are earned.
For example, if there is a Tetris state like the shape at the top, the state changes to the shape at the bottom.

.*...*....
**********
.******.**    
**********
.***.*****  

    || 
    \/

.*...*....
.******.**
 .***.*****

Given the state of Tetris, write a program that outputs the result of that state.

Input

First, the number of test cases T (1 <= T <= 100) is input.
Next, the number of map rows R is input equal to the number of test cases. Next, Tetris map information is input, where * represents a block and . represents an empty space. It is assumed that the number of columns is always fixed at 15. (5 <= R <= 25)

Output

For each test case, output the state of the Tetris map. Also, if all lines are cleared, do not output anything. (Do not insert blank lines between the test case results.)

Sample Input Copy

1
5
.*...*.........
***************
.******.**..*..
***************
.***.*****...**

Sample Output Copy

.*...*.........
.******.**..*..
.***.*****...**

Source/Category