FTI Programming Contest 2018 (Kategori 2017)

Start

2018-05-21 02:10 UTC

FTI Programming Contest 2018 (Kategori 2017)

End

2018-05-21 05:40 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -308 days 4:09:22

Time elapsed

3:30:00

Time remaining

0:00:00

Problem C
Mirror Images

Atrebla is developing a new smartphone camera app that she believe will be the next big hit on the app store. Camera apps usually display the image mirrored left-to-right on the screen, so that what you see on the screen matches the movement of your face. To help her camera app stand out from the rest, Atrebla will be adding a unique effect that mirrors an image both left-to-right and top-to-bottom. Help her implement this feature.

Input

The first line contains a single integer $T \leq 100$ giving the number of test cases. Each test case starts with a line containing an integer $R$ ($1 \leq R \leq 20$), the number of rows in the image, and an integer $C$ ($1 \leq C \leq 20$), the number of columns. The next $R$ lines contain $C$ characters, all of which are either . or *.

Output

For each test case, output a line containing “Test $x$” where $x$ is the test case number starting from $1$. After that, output the mirrored image.

Sample Input 1 Sample Output 1
2
2 2
.*
..
4 4
***.
**..
....
....
Test 1
..
*.
Test 2
....
....
..**
.***