5016 - Poker   

Description

Stud is a popular poker gamble and TPC get a Poker Online Game project from Gamanix Company.

In this game, each player have 5 cards, and they do the gambling by comparing the combination type of cards.

Your job is writing a program to determine what kind of combination types for someone's cards.

There are the rules of combination types

1.Straight Flush  (同花順)  五張的花色相同且五張的點數是連續的或AKOJT
2.Four of a Kind  (四條)    有四張點數相同
3.Full House       (葫蘆)    有三張點數相同且另兩張點數相同
4.Flush          (同花)    五張的花色相同
5.Straight      (順子)    五張的點數是連續的或AKOJT
6.Three of a Kind (三條)    有三張點數相同
7.Two Pairs      (兩對)    有兩對兩張點數相同
8.Pair          (一對)    有兩張點數相同
9 Zilch      (散牌)    沒有任何特殊牌型

Input

The first line of the input will contains an integer T (1<=T<=100) represent the number of testcase. The next T lines will contains five cards in each line. Cards are represented as a two character code. The the first character is the suit (C=Clubs, D=Diamonds, H=Hearts, S=Spades), and the second character is the face-value (A=Ace, 2-9, T=10, J=Jack, Q=Queen, K=King) .

Output

For each line of the five cards, please output the type of the cards.

Sample Input  Download

Sample Output  Download

Tags




Discuss