Since the beginning of the AGM contest, the members of the committee have had a favourite game which we always play before the contest for good luck.
The game is played between $$$3$$$ players using $$$N$$$ cards. The game has perfect information, all the players know all the cards in the game. Each player has $$$N/3$$$ cards of the following types:
The game is played in turns. At the end of a turn, the starting player for the next turn is determined and the process repeats until all the players have no cards left. The rules for a turn are the following:
At the end of the game (when all the players have no cards left), the winner of the game is the player that has more points than each of the other two players (in the case there are more players with the maximum number of points, there are no winners).
In this game, you are the player $$$0$$$ (note: player $$$0$$$ is not always the starting player of the first turn). Your objective is to win the game. The other two players have no interest in winning, but they will do the optimal strategy in order to not let you win (classic sportsmanship).
If everyone plays the optimal strategy, we want you to determine if you can win the game or not.
The first line of the input contains the integers $$$N$$$ ($$$3 \leq N \leq 15$$$, N multiple of 3) and $$$P$$$ ($$$0 \leq P \leq 2$$$), denoting the total number of cards and the player who starts the game. The next $$$3$$$ lines have $$$N/3$$$ cards separated by spaces (a card can be $$$7$$$, $$$8$$$, $$$9$$$, $$$10$$$, $$$A$$$, $$$J$$$, $$$Q$$$ or $$$K$$$), denoting the cards of player $$$0$$$, $$$1$$$, and $$$2$$$, respectively.
Print $$$YEE!$$$ if there is an optimal strategy in order to win or $$$OOH...$$$ otherwise.
3 1 7 A A
YEE!
6 2 8 A 7 7 9 Q
OOH...
15 0 Q A 10 10 7 10 J A A 9 8 9 J 8 Q
YEE!
In the first example, player $$$1$$$ starts the game with $$$A$$$, player $$$2$$$ puts another $$$A$$$ and player $$$0$$$ puts a $$$7$$$. Because player $$$1$$$ cannot contest now (has no cards left), player $$$0$$$ is the one that attacked last (even if player $$$2$$$ attacked before him by putting a $$$A$$$), thus winning the $$$2$$$ points in the turn and winning the game.
In the second example, any strategy player $$$0$$$ chooses, player $$$1$$$ and player $$$2$$$ will always succeed in making him lose.