{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eAs we know,daizhenyang likes playing chess,but he always lose,so one day,he invented a brand new chess game with the new rule.\u003cbr\u003e\u003cbr\u003eThe game is played on a chessboard with R rows and C columns, for a total of RC squares. Some of these squares are considered unlucky,so the chessman can\u0027t be moved to there.\u003cbr\u003eThe rule of this game is simple,diffrent from traditional chess,there is only a King on the chessboard beacuse daizhenyang thinks various chessmans leads to complex rule which makes poor daizhenyang hard to understand.\u003cbr\u003eAlso daizhenyang want\u0027s make the only chessman more powerful in order to become more unbeatable,The King is no longer the traditional weak king,it integrates the power of Guard,bishop,pawn,as well as knight.And the move range is not confined.It can move to anywhere which is considered lucky. So, according to the graph, the red king can move to 20 adjacent places.\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/49cf39058de496b7eeb57957ef8a194b?v\u003d1715933968\"\u003e\u003c/center\u003e \u003cbr\u003eAnd the aim of this game is simple too,The so-called King is placed in a random square of the chessboard which is considered lucky.Two players move the King alternately,in any move,the destination square must not be unlucky,and the king must never have been in the destination square before,which will causes dead loops.The first people who can\u0027t do a valid move lose.\u003cbr\u003edaizhenyang is playing chess with another people,who is too shy to told his name.And daizhenyang moves first,he asks you--the genius programmer,for help.\u003cbr\u003eplease write a program to judge whether daizhenyang will win.Assume both player will play optimally.\u003cbr\u003e\u003cbr\u003eThe first line of input gives the number of cases, N.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"N test cases follow. The first line of each case will contain two integers, R and C. The next R lines will contain strings of length C, representing the C squares of each row.(1\u0026lt;\u003dR,C\u0026lt;\u003d15) Each string will contain only the characters \u0027.\u0027, \u0027#\u0027 and \u0027K\u0027:\u003cbr\u003e\u0027#\u0027 means the square is considered unlucky;\u003cbr\u003e\u0027.\u0027 means the square is considered lucky, and unoccupied; and\u003cbr\u003e\u0027K\u0027 means the king is in that square at the beginning of the game.\u003cbr\u003eThere will be only one \u0027K\u0027 character in each test case."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line containing \"Case #X: \" (where X is the case number, starting from 1) followed by \"daizhenyang win\" if daizhenyang wins, or \"daizhenyang lose\" if daizhenyang lose.\u003cbr\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\u003e2\r\n2 2\r\nK.\r\n.#\r\n\r\n4 2\r\nK#\r\n.#\r\n.#\r\n.#\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: daizhenyang lose\r\nCase #2: daizhenyang win\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"In case 1,daizhenyang can do 2 choices,but no matter what he choose,the opponent will move to another,which makes daizhenyang unable to move.\u003cbr\u003eIn case 2,daizhenyang moves down,opponent moves down,daizhenyang moves down,he win!\u003cbr\u003e"}}]}