Poker Solitaire Evaluator 

Input

Standard input gets 25 cards, 5 cards per line. Each card consists of two characters. The first represents the rank of the card: `A', `2', `3', `4', `5', `6', `7', `8', `9', `X', `J', `Q', `K'. The second represents the suit of the card: `S', `H', `D', `C'.

The cards are dealt into a tex2html_wrap_inline44 square. Each row and column is evaluated to determine the highest hand type for which its 5 cards qualify. The hand types, from low to high, are Nothing, Pair, Two Pair, Three of a Kind, Straight, Flush, Full House, Four of a Kind, Straight Flush. A hand qualifies only once, and then only for its highest type. For example, a Four of a Kind does not count as two pair or three of a kind.

Output

A list of 9 integers, telling how many hands of each handtype were found. from lowest to highest, being:

  1. Nothing: does not qualify as any of the following. Example: AC, 3H, QS, JD, 7D.

  2. One Pair: contains two cards of the same rank and does not qualify for any of the following. Example: 2C, 3H, 4H, 2H, KD.

  3. Two Pair: contains two cards of one rank and two cards of another and does not qualify for any of the following. Example: 2C, 3H, 4H, 2H, 4D.

  4. Three of a Kind: contains three cards of the same rank and does not qualify for any of the following. Example: QS, KH, 2C, QD, QC.

  5. Straight: the five cards of the hand may be sorted on rank so that an unbroken sequence of 5 ranks is formed and the hand does not qualify for any of the following. Aces count high or low. That is AC, 2H, 4D, 3H, 5S forms a straight, as does JH, XD, QC, KD, AS.

  6. Flush: the five cards are all of the same suit and the hand does not qualify for any of the following. Example: 5D, AD, KD, 7D, QD.

  7. Full House: the hand contains three cards of one rank and two cards of another. Example: 3C, QS, QD, 3H, 3S.

  8. Four of a kind: the hand contains four cards of the same rank. Example: AS, AD, AH, 7C, AC.

  9. Straight Flush: the hand meets the criteria for being both a straight and a flush.

For the example below, the five rows evaluate to Straight Flush, Straight, Pair, Flush, Three of a Kind. The Five columns evaluate to Four of A Kind, Full House, Two Pair, Nothing, and Two Pair.

Sample Input

AS 2S 3S 4S 5S
AC 2H 3H 5C 4C
AH 2D KC KH 5D
AD 3D KD 9D 8D
XH 3C XC XS 8C

Sample Output

1, 1, 2, 1, 1, 1, 1, 1, 1, 1