{"raw_statement":[{"iden":"problem statement","content":"**This is an interactive problem. Because the judge program (interactor) requires around 1 second in the worst case, the time limit is set to be longer.**\nYou have eventually reached the castle of Great Satan DEGwer after 10-year journey. The entrance of the castle is a dungeon, which cannot avoid for arriving at DEGwer.\nThe dungeon is of form a grid with $H$ rows and $W$ columns. Each of $H \\times W$ squares is a room, and there is a **door** between any pair of adjacent rooms. In addition, there is an **entrance door** on the left side of each room located in the left-most column, and there is an **exit door** on the right side of each room located in the right-most column.\nNow, all the door are **unfixed**. You want to let the dungeon such that some open exit door can be reached from some open entrance door by repeatedly passing through open doors, and DEGwer wants to prevent your objective. For their own objectives, you and DEGwer alternately use the following magics.\n\n*   Your magic: Choose any unfixed door, fix it as open (passable).\n*   DEGwer's magic: Choose any unfixed door, fix it as closed (impassable).\n\nYou are given the size $(H, W)$ of the dungeon and who uses the magic first. Determine whether your objective is achievable or not when you and DEGwer do their best. In addition, if your objective is achievable, indicate **interactively** one possible way (your magics) to do so."},{"iden":"constraints","content":"*   $1 \\leq H \\leq 20$\n*   $1 \\leq W \\leq 20$\n*   $\\textrm{move}$ is either `First` or `Second`, where `First` means that you use the magic first, and `Second` means that DEGwer uses the magic first."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H$ $W$ $\\textrm{move}$"},{"iden":"sample input 1","content":"1 1 First"},{"iden":"sample output 1","content":"No\n\nIn this case, the dungeon consists of only one room, whose left side has a unique entrance door and right side has a unique exit door. For your objective, you have to fix both doors as open, but it cannot be done even if you use the magic first. Thus, your objective is not achievable."},{"iden":"sample input 2","content":"2 1 First"},{"iden":"sample output 2","content":"Yes\n...\n\nIn this case, as shown in below, the dungeon consists of two vertically adjacent rooms, there is a unique vertically passable door between them, and the left and right sides of both rooms have two entrance and exit doors, respectively, in total.\n\n| |\n -\n| |\n\nYou use the magic first, and suppose that you choose the unique vertically passable door `- 1 1`. Then, no matter how DEGwer will choose doors, you can choose one from the remaining two entrance doors and one from the remaining two exit doors, which achieve your objective because the two rooms became connected by your first magic.\nThe following is an example of interactive inputs and outputs.\n\nInput   \n\nOutput \n\nExplanation\n\n`2 1 First`\n\nAn input is given.\n\n`Yes`\n\nAs your objective is achievable, you print `Yes`.\n\n`- 1 1`\n\nYou fix as open one that is $1$st from the top and $1$st from the left among the vertically passable door.\n\n`| 1 2`\n\nDEGwer fixes as closed one that is $1$st from the top and $2$nd from the left among the horizontally passable doors, i.e., the upper-right exit door.\n\n`| 2 2`\n\nYou fix as open one that is $2$nd from the top and $2$nd from the left among the horizontally passable doors, i.e., the lower-right exit door.\n\n`| 2 1`\n\nDEGwer fixes as closed one that is $2$nd from the top and $1$st from the left among the horizontally passable doors, i.e., the lower-left entrance door.\n\n`| 1 1`\n\nYou fix as open one that is $1$st from the top and $1$st from the left among the horizontally passable doors, i.e., the upper-left entrance door.\n\n`a 0 0`\n\nAt this point, it is confirmed that the open lower-right exit door can be reached from the open upper-left entrance door, and your program must halt immediately after receiving the input indicating it."},{"iden":"sample input 3","content":"2 1 Second"},{"iden":"sample output 3","content":"No\n\nThe dungeon is the same as above, but your objective is not achievable as DEGwer uses the magic first. For example, if DEGwer fixes the unique vertically passable door (that you choose first in Sample 2) as closed, then the situation is just like two parallel copies of Sample 1, in which your objective is not achievable even if you use the magic first."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}