시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 19 11 10 62.500%

문제

지리지도는 R*C개의 글자로 나타낸다.

어떤 조그만 나라의 지도가 있다. 여기서 마을은 소문자 'x'로 표시되어 있고, 마을의 이름은 알파벳 대문자로 나타내고, 왼쪽에서 오른쪽으로 읽는다.

각 마을의 이름은 그 위치의 옆에 있다. 조금 더 자세히 설명하자면, 적어도 하나의 마을의 이름의 문자는 마을의 위치의 인접한 8개의 칸 중에 하나에 있다.

마을의 근처에 이름이 여러 개가 있을 수도 있고, 이름의 근처에 마을이 여러 개 있을 수도 있다. 하지만, 항상 마을의 위치와 이름을 유일하게 결정할 수 있다.

이때, 각 마을의 위치와 이름을 알아내는 프로그램을 작성하시오.

입력

첫째 줄에 행과 열의 개수 R과 C가 주어진다. (1 ≤ R ≤ 50, 1 ≤ S ≤ 50)

다음 R개의 줄에는 지도를 나타내는 C개의 문자가 주어진다. 각 문자는 '.', 'x', 또는 대문자이다.

마을의 이름은 항상 서로 다르다. 한 행에 여러 개의 마을 이름이 있을 때는, 적어도 하나의 '.'나 'x'로 구분되어 있다.

출력

각 마을의 위치와 이름을 한 줄에 하나씩 출력한다. 가장 위에서부터 1행부터 R행, 가장 왼쪽부터 1열부터 C열이다. 마을의 이름이 결정되는 방법이 여러 가지일 경우에는 아무거나 출력하면 된다. 또, 순서는 아무렇게 출력해도 된다.

예제 입력 1

12 31
...............................
.............ZAGREB............
..............x................
.......................OSIJEKx.
.....x.........................
......RIJEKA...................
...............................
...............................
...............................
..............SPLIT............
...............x...............
...............................

예제 출력 1

3 15 ZAGREB
4 30 OSIJEK
5 6 RIJEKA
11 16 SPLIT
W3sicHJvYmxlbV9pZCI6IjMxNDUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM5YzBcdWI5YWNcdWM5YzBcdWIzYzQiLCJkZXNjcmlwdGlvbiI6IlxyXG48cD5cclxuXHRcdWM5YzBcdWI5YWNcdWM5YzBcdWIzYz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