/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 233 点
問題文
高橋君は縦 H 行、横 W 列のマス目に英小文字を 1 文字ずつ書いた手記を持っています。手記の内容は H 個の文字列 S_1, S_2, \ldots, S_H で表され、 S_i の j 文字目は上から i 行目、左から j 列目のマスに書かれた文字です。
この手記には秘密のメッセージが隠されており、左から K 列目の文字を上から下へ順に読むと現れます。秘密のメッセージを出力してください。
制約
- 1 \leq H \leq 10
- 1 \leq W \leq 10
- 1 \leq K \leq W
- S_i は英小文字のみからなる長さ W の文字列
- H 、 W 、 K は整数
入力
入力は以下の形式で標準入力から与えられる。
H W K S_1 S_2 \vdots S_H
- 1 行目には、手記の行数 H 、列数 W 、読む列 K がスペース区切りで与えられる。
- 2 行目から H 行にわたり、 1 + i 行目には上から i 行目の内容を表す文字列 S_i が与えられる。
出力
秘密のメッセージ(長さ H の文字列)を 1 行で出力せよ。
入力例 1
2 2 1 ab ba
出力例 1
ab
入力例 2
3 3 2 abc bde cef
出力例 2
bde
入力例 3
1 1 1 z
出力例 3
z
入力例 4
2 2 2 ab ba
出力例 4
ba
入力例 5
3 3 3 abc bde cef
出力例 5
cef
Score : 233 pts
Problem Statement
Takahashi has a memoir in which he wrote one lowercase English letter in each cell of a grid with H rows and W columns. The contents of the memoir are represented by H strings S_1, S_2, \ldots, S_H, where the j-th character of S_i is the letter written in the cell at the i-th row from the top and the j-th column from the left.
A secret message is hidden in this memoir, which appears when the characters in the K-th column from the left are read from top to bottom. Print the secret message.
Constraints
- 1 \leq H \leq 10
- 1 \leq W \leq 10
- 1 \leq K \leq W
- S_i is a string of length W consisting only of lowercase English letters
- H, W, and K are integers
Input
The input is given from Standard Input in the following format:
H W K S_1 S_2 \vdots S_H
- The first line contains the number of rows H, the number of columns W, and the column to read K, separated by spaces.
- For each i from 1 to H, the (1+i)-th line contains the string S_i representing the contents of the i-th row from the top.
Output
Print the secret message (a string of length H) in one line.
Sample Input 1
2 2 1 ab ba
Sample Output 1
ab
Sample Input 2
3 3 2 abc bde cef
Sample Output 2
bde
Sample Input 3
1 1 1 z
Sample Output 3
z
Sample Input 4
2 2 2 ab ba
Sample Output 4
ba
Sample Input 5
3 3 3 abc bde cef
Sample Output 5
cef