102961: [Atcoder]ABC296 B - Chessboard

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

Description

Score : $200$ points

Problem Statement

Locate a piece on a chessboard.

We have a grid with $8$ rows and $8$ columns of squares. Each of the squares has a $2$-character name determined as follows.

  • The first character of the name of a square in the $1$-st column from the left is a. Similarly, the first character of the name of a square in the $2$-nd, $3$-rd, $\ldots$, $8$-th column from the left is b, c, d, e, f, g, h, respectively.
  • The second character of the name of a square in the $1$-st row from the bottom is 1. Similarly, the second character of the name of a square in the $2$-nd, $3$-rd, $\ldots$, $8$-th row from the bottom is 2, 3, 4, 5, 6, 7, 8, respectively.

For instance, the bottom-left square is named a1, the bottom-right square is named h1, and the top-right square is named h8.

You are given $8$ strings $S_1,\ldots,S_8$, each of length $8$, representing the state of the grid.
The $j$-th character of $S_i$ is * if the square at the $i$-th row from the top and $j$-th column from the left has a piece on it, and . otherwise. The character * occurs exactly once among $S_1,\ldots,S_8$. Find the name of the square that has a piece on it.

Constraints

  • $S_i$ is a string of length $8$ consisting of . and*.
  • The character * occurs exactly once among $S_1,\ldots,S_8$.

Input

The input is given from Standard Input in the following format:

$S_1$
$S_2$
$S_3$
$S_4$
$S_5$
$S_6$
$S_7$
$S_8$

Output

Print the answer.


Sample Input 1

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

Sample Output 1

a1

As explained in the problem statement, the bottom-left square is named a1.


Sample Input 2

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

Sample Output 2

b3

Input

题意翻译

令 $c_i$ 表示小写字母表中的第 $i$ 个字母。 有一个 $8\times 8$ 大小的棋盘,其中从下至上第 $i$ 行,从左至右第 $j$ 列被表示为 $(c_j,i)$。 现在棋盘上有一个用 `*` 表示的棋子,剩下的都是 `.`,输出棋子的坐标。 Translated by @[Zealous_YH](https://www.luogu.com.cn/user/399150)

Output

得分:200分

问题描述

在国际象棋棋盘上找到一个棋子。

我们有一个由8行和8列正方形组成的网格。每个正方形都有一个由以下方法确定的2个字符的名称。

  • 从左数第1列的正方形名称的第一个字符是a。类似地,从左数第2、3、…、8列的正方形名称的第一个字符分别是bcdefgh
  • 从下数第1行的正方形名称的第二个字符是1。类似地,从下数第2、3、…、8行的正方形名称的第二个字符分别是2345678

例如,左下角的正方形名称是a1,右下角的正方形名称是h1,右上角的正方形名称是h8

给你8个字符串$S_1,\ldots,S_8$,每个长度为8,表示网格的状态。

如果从上数第$i$行和从左数第$j$列的正方形上有一个棋子,则$S_i$的第$j$个字符是*,否则是.。 在$S_1,\ldots,S_8$中,字符*出现且仅出现一次。 找出有棋子的正方形的名称。

约束条件

  • $S_i$是一个由.*组成的长度为8的字符串。
  • 在$S_1,\ldots,S_8$中,字符*出现且仅出现一次。

输入

输入通过标准输入以以下格式给出:

$S_1$
$S_2$
$S_3$
$S_4$
$S_5$
$S_6$
$S_7$
$S_8$

输出

打印答案。


样例输入1

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

样例输出1

a1

如问题描述中所述,左下角的正方形名称是a1


样例输入2

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

样例输出2

b3

HINT

8行8列字符矩阵,从左往右列号为a~h,从上往下行号为1~8,输出*的位置?

加入题单

算法标签: