CF1850C.Word on the Paper

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Word on the Paper

On an 8×88 \times 8 grid of dots, a word consisting of lowercase Latin letters is written vertically in one column, from top to bottom. What is it?

Input

The input consists of multiple test cases. The first line of the input contains a single integer tt (1t10001 \leq t \leq 1000) — the number of test cases.

Each test case consists of 88 lines, each containing 88 characters. Each character in the grid is either . (representing a dot) or a lowercase Latin letter (az).

The word lies entirely in a single column and is continuous from the beginning to the ending (without gaps). See the sample input for better understanding.

Output

For each test case, output a single line containing the word made up of lowercase Latin letters (az) that is written vertically in one column from top to bottom.

Samples

5
........
........
........
........
...i....
........
........
........
........
.l......
.o......
.s......
.t......
........
........
........
........
........
........
........
......t.
......h.
......e.
........
........
........
........
........
.......g
.......a
.......m
.......e
a.......
a.......
a.......
a.......
a.......
a.......
a.......
a.......
i
lost
the
game
aaaaaaaa

在线编程 IDE

建议全屏模式获得最佳体验