The game of show hand is a card game. There are 52 cards and each card has a number and a suit. There are 13 different numbers called 2, 3, 4, 5, 6, 7, 8, 9, T (number 10), J (number 11), Q (number 12), K (number 13) and A (number 1 or 14), and there are 4 different suits called diamond (d), club (c), heart (h), and spade (s). A card can be represented as its number and its suit. For example, the card with number 10 and suit diamond is represented as “Td”, where “T” is for number 10 and “d” is for suit diamond. A hand is a combination of 5 cards.
There are 9 different kinds of hands, sorted from best to worst, listed below.
“Straight Flush”: 5 cards with consecutive numbers and the same suit. For example: Td Jd Qd Kd Ad.
“4 of a Kind”: 4 cards with the same number and an arbitrary single card. For example: 2d 2c 2h 2s 3d.
“Full House”: 3 cards with the same number and the remaining 2 cards have the same number. For example: 6d 6h 6s 7c 7s.
“Flush”: 5 cards with the same suit but not consecutive numbers. For example: 2h 3h Qh Kh Ah.
“Straight”: 5 cards with consecutive numbers but not the same suit. For example: As 2s 3s 4d 5d.
“3 of a Kind”: 3 cards with the same number and the remaining 2 cards have different numbers. For example: Td Tc Ts 9s As.
“2 Pairs”: 2 pairs of cards with the same number and the remaining card has a different number. For example: 3h 3s 6c 6h 4h.
“1 Pair”: 2 cards with the same number and the remaining 3 cards have different numbers. For example: 4d 4c 2c 5d Ac.
“High Card”: 5 cards with different, not consecutive numbers and not the same suits. For example: 2c 3d 8c 9h Ah.
There are 2 players in the game of five-round show hand. When the game starts, each player will get 25 cards from the dealer. Then, for each round, each player shows a hand by choosing 5 cards from the cards he gets, and two players compare the hands they showed. The player who shows a better kind of hand wins the game. If they show the same kind of hands, they discard the cards they have shown and proceed to the next round. There are at most 5 rounds in a game. If they show the same kind of hands in all of the 5 rounds, the game ends in a tie.
Both players play optimally. Your task is to find out the winner and the kind of hands he shows.