{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eDuring a discussion of problems at the Petrozavodsk Training \r\nCamp, Vova and Sasha argued about who of them could in 300 \r\nminutes find a pair of equal squares of the maximal size\r\nin a matrix of size \u003ci\u003eN\u003c/i\u003e\u0026nbsp;×\u0026nbsp;\u003ci\u003eM\u003c/i\u003e containing lowercase English letters. Squares could overlap each other but could not coincide. He who had found a pair of greater size won. Petr walked by, looked at the matrix, said that the optimal pair of squares had sides \u003ci\u003eK\u003c/i\u003e, and walked on. Vova and Sasha still cannot find this pair. Can you help them?\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains integers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eM\u003c/i\u003e separated with a space. 1\u0026nbsp;≤\u0026nbsp;\u003ci\u003eN\u003c/i\u003e,\u0026nbsp;\u003ci\u003eM\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;500.\r\nIn the next \u003ci\u003eN\u003c/i\u003e lines there is a matrix consisting of\r\nlowercase English letters, \u003ci\u003eM\u003c/i\u003e symbols per line.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIn the first line, output the integer \u003ci\u003eK\u003c/i\u003e which Petr said. In the next two lines, give coordinates of upper left corners of maximal equal squares. If there exist more than one pair of equal squares of size \u003ci\u003eK\u003c/i\u003e, than you may output any of them. The upper left cell of the matrix has coordinates (1,\u0026nbsp;1), and the lower right cell has coordinates (\u003ci\u003eN\u003c/i\u003e,\u0026nbsp;\u003ci\u003eM\u003c/i\u003e). If there are no equal squares in the matrix, then output 0.\u003c/div\u003e\u003c/div\u003e"}},{"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\u003e5 10\r\nljkfghdfas\r\nisdfjksiye\r\npgljkijlgp\r\neyisdafdsi\r\nlnpglkfkjl\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n1 1\r\n3 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}