시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 89 20 18 29.032%

문제

최근에 고고학자들이 그리스-로마 건축을 발견했다. 이 장소는 R*C칸으로 모델링 되어 있다. 고고학자들은 각 칸에 빌딩이 있었는지 없었는지를 표시해 두었다.

고고학자들은 이 장소에 서로 다른 시대에 지어진 두 건물이 있었다는 사실을 알게되었다. 또, 두 건물의 바닥 모양은 정사각형이었다.

두 건물이 서로 다른 시대에 지어졌기 때문에, 바닥이 겹칠 수도 있다. 이때, 가능한 위치와 크기를 구하는 프로그램을 작성하시오. 

입력

첫째 줄에 발견한 장소의 크기인 R과 C가 주어진다. (1 ≤ R ≤ 100, 1 ≤ C ≤ 100)

다음 R개의 줄에는 C개의 문자가 주어진다. 각 문자는 '.' 또는 'x'이고, '.'인 경우에는 그 칸에 건물의 흔적이 없었다는 뜻이고, 'x'는 건물이 있었다는 뜻이다.

출력

두 건물의 바닥의 왼쪽 위 좌표와 크기를 출력한다. 항상 답이 존재하는 경우만 주어진다.

예제 입력 1

3 3
xx.
xxx
...

예제 출력 1

1 1 2
2 3 1
W3sicHJvYmxlbV9pZCI6IjI5NjciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFkZjhcdWI5YWNcdWMyYTQtXHViODVjXHViOWM4IFx1YWM3NFx1Y2Q5NSIsImRlc2NyaXB0aW9uIjoiXHJcbjxwPlxyXG5cdFx1Y2Q1Y1x1YWRmY1x1YzVkMCBcdWFjZTBcdWFjZTBcdWQ1NTlcdWM3OTBcdWI0ZTRcdWM3NzQgXHVhZGY4XHViOWFjXHVjMmE0LVx1Yjg1Y1x1YjljOCBcdWFjNzRcdWNkOTVcdWM3NDQgXHViYzFjXHVhY2FjXHVkNTg4XHViMmU0LiBcdWM3NzQgXHVjN2E1XHVjMThjXHViMjk0IFIqQ1x1Y2U3OFx1YzczY1x1Yjg1YyBcdWJhYThcdWIzNzhcdWI5YzEgXHViNDE4XHVjNWI0IFx1Yzc4OFx1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