A player is playing a simplified version of poker with collectible cards. Each card has a symbol representing its type. The player receives five cards and must determine the strength of their combination. Possible combinations are:
no pair: All five cards have different symbols;
pair: There is a pair of cards with the same symbol;
two pair: There are two pairs of cards with the same symbols (the fifth card has a different symbol);
set: Three cards have the same symbol;
full house: Three cards of one symbol and two cards of another;
quads: Four cards have the same symbol;
poker: All five cards have the same symbol.
Ratings are listed in order of increasing significance. If one combination matches several categories, the most significant rating is chosen.
Write a program that evaluates the combinations for all players.
The first line contains an integer (1 \leq T \leq 10000) — the number of players. Each of the next lines contains five symbols separated by spaces. Each symbol consists of at most lowercase Latin letters.
Output lines. On each line, print the rating of the combination for the corresponding player.
Example 1