Poker#177

Poker

1 second
64 megabytes
Very easy

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:

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.

Input

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

Output lines. On each line, print the rating of the combination for the corresponding player.

Examples

Example 1

Loading
Loading