{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp style\u003d\"text-align: justify;\"\u003e\r\n\tHave you ever played Minesweeper? It\u0026#39;s a cute little game which comes within a certain Operating System which name we can\u0026#39;t really remember. Well, the goal of the game is to find where are all the mines within a \u003cspan data-scayt_word\u003d\"MxN\" data-scaytid\u003d\"1\"\u003eMxN\u003c/span\u003e field. To help you, the game shows a number in a square which tells you how many mines there are adjacent to that square. For instance, \u003cspan data-scayt_word\u003d\"supose\" data-scaytid\u003d\"2\"\u003esupose\u003c/span\u003e the following \u003cspan data-scayt_word\u003d\"4x4\" data-scaytid\u003d\"3\"\u003e4x4\u003c/span\u003e field with 2 mines (which are represented by an * character):\u003c/p\u003e\r\n\u003cpre style\u003d\"text-align: justify;\"\u003e\r\n*...\r\n....\r\n.*..\r\n....\r\n\u003c/pre\u003e\r\n\u003cp style\u003d\"text-align: justify;\"\u003e\r\n\tIf we would represent the same field placing the hint numbers described above, we would end up with:\u003c/p\u003e\r\n\u003cpre style\u003d\"text-align: justify;\"\u003e\r\n*100\r\n2210\r\n1*10\r\n1110\r\n\u003c/pre\u003e\r\n\u003cp style\u003d\"text-align: justify;\"\u003e\r\n\tAs you may have already noticed, each square may have at most 8 adjacent squares.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cspan style\u003d\"text-align: justify;\"\u003eThe input will consist of an arbitrary number of fields. The first line of each field contains two integers n and m (0 \u0026lt; n,m \u0026lt;\u003d 100) which stands for the number of lines and columns of the field respectively. The next n lines contains exactly m characters and represent the field. Each safe square is represented by an \u0026quot;.\u0026quot; character (without the quotes) and each mine square is represented by an \u0026quot;*\u0026quot; character (also without the quotes). The first field line where n \u003d m \u003d 0 represents the end of input and should not be processed.\u003c/span\u003e\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp style\u003d\"text-align: justify;\"\u003e\r\n\tFor each field, you must print the following message in a line alone:\u003c/p\u003e\r\n\u003cpre style\u003d\"text-align: justify;\"\u003e\r\nField #x:\u003c/pre\u003e\r\n\u003cp style\u003d\"text-align: justify;\"\u003e\r\n\tWhere x stands for the number of the field (starting from 1). The next n lines should contain the field with the \u0026quot;.\u0026quot; characters replaced by the number of adjacent mines to that square. There must be an empty line between field outputs.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre style\u003d\"text-align: justify;\"\u003e\r\n4 4\r\n*...\r\n....\r\n.*..\r\n....\r\n3 5\r\n**...\r\n.....\r\n.*...\r\n0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre style\u003d\"text-align: justify;\"\u003e\r\nField #1:\r\n*100\r\n2210\r\n1*10\r\n1110\r\n\r\nField #2:\r\n**100\r\n33200\r\n1*100\u003c/pre\u003e"}}]}