310549: CF1850C. Word on the Paper

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:5 Solved:0

Description

C. Word on the Papertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

On an $8 \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 $t$ ($1 \leq t \leq 1000$) — the number of test cases.

Each test case consists of $8$ lines, each containing $8$ characters. Each character in the grid is either $\texttt{.}$ (representing a dot) or a lowercase Latin letter ($\texttt{a}$–$\texttt{z}$).

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 ($\texttt{a}$–$\texttt{z}$) that is written vertically in one column from top to bottom.

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

Input

题意翻译

### 【题目描述】 给你一个 $8×8$ 的方格,这个方阵由**小写字母**和 `.` 组成,这些小写字母排成了**竖列**,它们是**一个**字符串,请你横向输出这个字符串。 ### 【输入格式】 本题由多组测试用例构成,第一行是一个整数 $t$($1 \le t \le 1000$),表示测试用例数量。 每个用例包含**8行8列**,即 $8×8$ 的方格(方格意义见“题目描述”)。输入是连续的,从头至尾没有间隙。 ### 【输出格式】 共 $t$ 行,每组测试用例占一行,每行包含一个字符串。

Output

题目大意:
在8x8的点阵上,一个由小写拉丁字母组成的单词被垂直地写在一列中,从上到下。需要找出这个单词是什么。

输入数据格式:
输入由多个测试案例组成。输入的第一行包含一个整数t(1≤t≤1000)——测试案例的数量。
每个测试案例由8行组成,每行包含8个字符。网格中的每个字符要么是`.`(代表一个点),要么是一个小写拉丁字母(`a`–`z`)。
单词完全位于单一列中,并且从开始到结束连续(没有间隙)。

输出数据格式:
对于每个测试案例,输出一个由小写拉丁字母(`a`–`z`)组成的单词,该单词垂直地写在一列中,从上到下。题目大意: 在8x8的点阵上,一个由小写拉丁字母组成的单词被垂直地写在一列中,从上到下。需要找出这个单词是什么。 输入数据格式: 输入由多个测试案例组成。输入的第一行包含一个整数t(1≤t≤1000)——测试案例的数量。 每个测试案例由8行组成,每行包含8个字符。网格中的每个字符要么是`.`(代表一个点),要么是一个小写拉丁字母(`a`–`z`)。 单词完全位于单一列中,并且从开始到结束连续(没有间隙)。 输出数据格式: 对于每个测试案例,输出一个由小写拉丁字母(`a`–`z`)组成的单词,该单词垂直地写在一列中,从上到下。

加入题单

上一题 下一题 算法标签: