{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e is a figure of the following type: an asterisk character \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e*\u003c/span\u003e\u0027 in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e is the length of its rays. The size of a star must be a positive number (i.e. rays of length $$$0$$$ are not allowed).\u003c/p\u003e\u003cp\u003eLet\u0027s consider empty cells are denoted by \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e\u0027, then the following figures are \u003cspan class\u003d\"tex-font-style-it\"\u003estars\u003c/span\u003e:\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/0f25e76b780dc0a70e198ce46c1d4d11?v\u003d1715756028\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003cspan class\u003d\"tex-font-size-small\"\u003eThe leftmost figure is a \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e of size $$$1$$$, the middle figure is a \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e of size $$$2$$$ and the rightmost figure is a \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e of size $$$3$$$.\u003c/span\u003e \u003c/center\u003e\u003cp\u003eYou are given a rectangular grid of size $$$n \\times m$$$ consisting only of asterisks \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e*\u003c/span\u003e\u0027 and periods (dots) \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e\u0027. Rows are numbered from $$$1$$$ to $$$n$$$, columns are numbered from $$$1$$$ to $$$m$$$. Your task is to draw this grid using \u003cspan class\u003d\"tex-font-style-it\"\u003eany\u003c/span\u003e number of \u003cspan class\u003d\"tex-font-style-it\"\u003estars\u003c/span\u003e or find out that it is impossible. \u003cspan class\u003d\"tex-font-style-it\"\u003eStars\u003c/span\u003e can intersect, overlap or even coincide with each other. The number of \u003cspan class\u003d\"tex-font-style-it\"\u003estars\u003c/span\u003e in the output can\u0027t exceed $$$n \\cdot m$$$. Each star should be completely inside the grid. You can use stars of same and arbitrary sizes.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eIn this problem, you do not need to minimize the number of stars. Just find any way to draw the given grid with at most $$$n \\cdot m$$$ stars.\u003c/span\u003e\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains two integers $$$n$$$ and $$$m$$$ ($$$3 \\le n, m \\le 100$$$) — the sizes of the given grid.\u003c/p\u003e\u003cp\u003eThe next $$$n$$$ lines contains $$$m$$$ characters each, the $$$i$$$-th line describes the $$$i$$$-th row of the grid. It is guaranteed that grid consists of characters \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e*\u003c/span\u003e\u0027 and \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e\u0027 only.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is impossible to draw the given grid using \u003cspan class\u003d\"tex-font-style-it\"\u003estars\u003c/span\u003e only, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e-1\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eOtherwise in the first line print one integer $$$k$$$ ($$$0 \\le k \\le n \\cdot m$$$) — the number of \u003cspan class\u003d\"tex-font-style-it\"\u003estars\u003c/span\u003e needed to draw the given grid. The next $$$k$$$ lines should contain three integers each — $$$x_j$$$, $$$y_j$$$ and $$$s_j$$$, where $$$x_j$$$ is the row index of the central \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e character, $$$y_j$$$ is the column index of the central \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e character and $$$s_j$$$ is the size of the \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e. Each \u003cspan class\u003d\"tex-font-style-it\"\u003estar\u003c/span\u003e should be completely inside the grid.\u003c/p\u003e"}},{"title":"Examples","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\u003e6 8\n....*...\n...**...\n..*****.\n...**...\n....*...\n........\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n3 4 1\n3 5 2\n3 5 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 5\n.*...\n****.\n.****\n..**.\n.....\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n2 2 1\n3 3 1\n3 4 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 5\n.*...\n***..\n.*...\n.*...\n.....\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e3 3\n*.*\n.*.\n*.*\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example the output \u003c/p\u003e\u003cpre class\u003d\"verbatim\"\u003e2\u003cbr\u003e3 4 1\u003cbr\u003e3 5 2\u003cbr\u003e\u003c/pre\u003e\u003cp\u003eis also correct.\u003c/p\u003e"}}]}