{"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\"\u003eThe 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.\u003cbr\u003eThere are 9 different kinds of hands, sorted from best to worst, listed below.\u003cbr\u003e“Straight Flush”: 5 cards with consecutive numbers and the same suit. For example: Td Jd Qd Kd Ad.\u003cbr\u003e“4 of a Kind”: 4 cards with the same number and an arbitrary single card. For example: 2d 2c 2h 2s 3d.\u003cbr\u003e“Full House”: 3 cards with the same number and the remaining 2 cards have the same number. For example: 6d 6h 6s 7c 7s.\u003cbr\u003e“Flush”: 5 cards with the same suit but not consecutive numbers. For example: 2h 3h Qh Kh Ah.\u003cbr\u003e“Straight”: 5 cards with consecutive numbers but not the same suit. For example: As 2s 3s 4d 5d.\u003cbr\u003e“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.\u003cbr\u003e“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.\u003cbr\u003e“1 Pair”: 2 cards with the same number and the remaining 3 cards have different numbers. For example: 4d 4c 2c 5d Ac.\u003cbr\u003e“High Card”: 5 cards with different, not consecutive numbers and not the same suits. For example: 2c 3d 8c 9h Ah.\u003cbr\u003eThere 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.\u003cbr\u003eBoth players play optimally. Your task is to find out the winner and the kind of hands he shows.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is the number of test cases up to 600.\u003cbr\u003eFor each test case, there are two lines. The first line is the 25 cards player 1 gets, and the second line is the 25 cards player 2 gets. It is guaranteed that all the 50 cards are different."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output a line containing the winner and the kind of hands he shows. If the game ends in a tie,output “Tie” and the kind of hands both player show."}},{"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\u003e3\r\n2d 2h 3d 3c 4d 4s 5d 6h 7d 7c 8d 8c 9d 9s\r\nTd Tc Ts Th Jh Js Qd Qh Kc As Ad\r\n2c 2s 3h 3s 4c 4h 5c 5h 5s 6d 6c 6s 7h 7s\r\n8s 8h 9c 9h Jd Jc Qc Qs Kd Ac Ah\r\n2s 3d 3c 3s 3h 4s 4h 5c 5s 6s 6h 7s 7h 8c\r\n8s Td Th Js Jh Qs Qh Kc Kh Ad As\r\n2d 2h 4d 4c 5d 5h 6d 6c 7d 7c 8d 8h 9d 9c\r\n9s 9h Tc Ts Jd Jc Qd Kd Ks Ac Ah\r\n2d 3d 4d 6d 7d 8d 9d Jd Qd Kd Ad 2c 3c 4c\r\n6c 7c 8c 9c Jc Qc Kc Ac 5h 5s Th\r\n2h 3h 4h 6h 7h 8h 9h Jh Qh Kh Ah 2s 3s 4s\r\n6s 7s 8s 9s Js Qs Ks As 5d Td Tc\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003ePlayer 1, Straight Flush\r\nPlayer 2, Straight Flush, 4 of a Kind,\r\nFlush, Straight, 1 Pair\r\nTie, Flush, Flush, Flush, Flush, 2 Pairs\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}