{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Sheryl works for a software company in the country of Brada. Her job is to develop a Windows operating system. People in Brada are incredibly conservative. They even never use graphical monitors! So Sheryl\u0027s operating system has to run in text mode and windows in that system are formed by characters. Sheryl decides that every window has an ID which is a capital English letter (\u0027A\u0027 to \u0027Z\u0027). Because every window had a unique ID, there can\u0027t be more than 26 windows at the same time. And as you know, all windows are rectangular.\r\u003cbr\u003e\r\u003cbr\u003eOn the screen of that ugly Windows system, a window\u0027s frame is formed by its ID letters. Fig-1 shows that there is only one window on the screen, and that window\u0027s ID is \u0027A\u0027. Windows may overlap. Fig-2 shows the situation that window B is on the top of window A. And Fig-3 gives a more complicated overlapping. Of course, if some parts of a window are covered by other windows, you can\u0027t see those parts on the screen.\r\u003cbr\u003e\u003cpre class\u003d\"sio\" style\u003d\"line-height:20px\"\u003e\r\u003cbr\u003e.........................\r\u003cbr\u003e....AAAAAAAAAAAAA........\r\u003cbr\u003e....A...........A........\r\u003cbr\u003e....A...........A........\r\u003cbr\u003e....A...........A........\r\u003cbr\u003e....AAAAAAAAAAAAA........\r\u003cbr\u003e.........................\r\u003cbr\u003e\r\u003cbr\u003eFig-1\r\u003cbr\u003e\r\u003cbr\u003e.........................\r\u003cbr\u003e....AAAAAAAAAAAAA........\r\u003cbr\u003e....A...........A........\r\u003cbr\u003e....A.......BBBBBBBBBB...\r\u003cbr\u003e....A.......B........B...\r\u003cbr\u003e....AAAAAAAAB........B...\r\u003cbr\u003e............BBBBBBBBBB...\r\u003cbr\u003e.........................\r\u003cbr\u003e\r\u003cbr\u003eFig-2\r\u003cbr\u003e\r\u003cbr\u003e..........................\r\u003cbr\u003e....AAAAAAAAAAAAA.........\r\u003cbr\u003e....A...........A.........\r\u003cbr\u003e....A.......BBBBBBBBBB....\r\u003cbr\u003e....A.......B........BCCC.\r\u003cbr\u003e....AAAAAAAAB........B..C.\r\u003cbr\u003e.......C....BBBBBBBBBB..C.\r\u003cbr\u003e.......CCCCCCCCCCCCCCCCCC.\r\u003cbr\u003e..........................\r\u003cbr\u003e\r\u003cbr\u003eFig-3\r\u003cbr\u003e\u003c/pre\u003e\r\u003cbr\u003eIf a window has no parts covered by other windows, we call it a “top window” (The frame is also considered as a part of a window). Usually, the top windows are the windows that interact with user most frequently. Assigning top windows more CPU time and higher priority will result in better user experiences. Given the screen presented as Figs above, can you tell Sheryl which windows are top windows?"}},{"title":"Input","value":{"format":"HTML","content":"The input contains several test cases.\r\u003cbr\u003e\r\u003cbr\u003eEach test case begins with two integers, n and m (1 \u0026lt;\u003d n, m \u0026lt;\u003d 100), indicating that the screen has n lines, and each line consists of m characters.\r\u003cbr\u003e\r\u003cbr\u003eThe following n lines describe the whole screen you see. Each line contains m characters. For characters which are not on any window frame, we just replace them with \u0027.\u0027 .\r\u003cbr\u003e\r\u003cbr\u003eThe input ends with a line of two zeros.\r\u003cbr\u003e\r\u003cbr\u003eIt is guaranteed that:\r\u003cbr\u003e\r\u003cbr\u003e1) There is at least one window on the screen.\r\u003cbr\u003e2) Any window\u0027s frame is at least 3 characters wide and 3 characters high.\r\u003cbr\u003e3) No part of any window is outside the screen."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the IDs of all top windows in a line without blanks and in alphabet order."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e9 26\r\n..........................\r\n....AAAAAAAAAAAAA.........\r\n....A...........A.........\r\n....A.......BBBBBBBBBB....\r\n....A.......B........BCCC.\r\n....AAAAAAAAB........B..C.\r\n.......C....BBBBBBBBBB..C.\r\n.......CCCCCCCCCCCCCCCCCC.\r\n..........................\r\n7 25\r\n.........................\r\n....DDDDDDDDDDDDD........\r\n....D...........D........\r\n....D...........D........\r\n....D...........D..AAA...\r\n....DDDDDDDDDDDDD..A.A...\r\n...................AAA...\r\n0 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eB\r\nAD\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}