Bridge is a great card game! The 2006 World Youth Team Championship in Bridge took place in Thailand, the same country that will host the 2016 ICPC World Finals! Let's describe the rules of bridge. The game is played with a standard 52-card deck, with 13 cards from each of the four suits (hearts, spades, clubs, and diamonds). The cards are ranked as A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2, with the ace having the highest rank and 2 the lowest. There is also a predetermined trump suit (H = hearts, S = spades, C = clubs, D = diamonds, NT = no trump).
The game is played by 4 players (N, E, S, W), as shown in the figure, and it has several rounds, called tricks. A player starts a round/trick by playing a card. Afterwards, each player plays a card, following clockwise order, until everyone has played. The trick then ends. The leading player in the trick can play whichever card she or he wants; this card's suit is defined as the current trick's suit. Every player other than the leading player must play a card of the same suit as the current trick's, unless she or he has no such card. In this case, the player can play any card.
The winner of a trick is defined as follows. If a trump card (a card of the trump suit) has been played, the winner is the player who played the highest ranking trump card. Otherwise, the winner is the player who played the highest ranking card of the trick's suit. The winner of a trick starts the next trick.
Player N starts the first trick. Players N and S play as a team, as do E and W. The goal is to win the most tricks.
In this problem, each player has R cards and we would like to know how many tricks team NS can win if everyone plays optimally.
The first line has a single integer T, the number of test cases.
Each test case starts with a line containing a string (one of _H_, _S_, _C_, _D_) representing the trump suit and an integer R representing the number of cards each player is dealt. The next 4 lines each contain a space-separated list of R cards. A card is represented as a string XY, where X is one of _A_, _K_, _Q_, _J_, _T_ (representing 10), _9_, _8_, _7_, _6_, _5_, _4_, _3_, _2_, and Y is the suit (one of _H_, _S_, _C_, _D_). The 4 lines contain the hands of the players N, E, S, and W, in this order. Note that no card appears twice!
*Limits*
For each test case print a single integer, the maximum number of tricks that the NS team can win.
## Input
The first line has a single integer T, the number of test cases.Each test case starts with a line containing a string (one of _H_, _S_, _C_, _D_) representing the trump suit and an integer R representing the number of cards each player is dealt. The next 4 lines each contain a space-separated list of R cards. A card is represented as a string XY, where X is one of _A_, _K_, _Q_, _J_, _T_ (representing 10), _9_, _8_, _7_, _6_, _5_, _4_, _3_, _2_, and Y is the suit (one of _H_, _S_, _C_, _D_). The 4 lines contain the hands of the players N, E, S, and W, in this order. Note that no card appears twice!*Limits* 1 ≤ T ≤ 100 1 ≤ R ≤ 4
## Output
For each test case print a single integer, the maximum number of tricks that the NS team can win.
[samples]
**Definitions**
Let $ T \in \mathbb{Z} $ be the number of test cases.
For each test case:
- Let $ \text{trump} \in \{H, S, C, D\} $ be the trump suit.
- Let $ R \in \mathbb{Z} $ be the number of cards per player ($ 1 \leq R \leq 13 $).
- Let $ P_N, P_E, P_S, P_W $ be the multisets of cards held by players N, E, S, W respectively, where each card is a pair $ (rank, suit) $.
- Define a total order on ranks: $ A > K > Q > J > T > 9 > 8 > 7 > 6 > 5 > 4 > 3 > 2 $.
**Constraints**
1. $ 1 \leq T \leq 100 $
2. $ 1 \leq R \leq 13 $
3. Each player has exactly $ R $ distinct cards.
4. All 4 players’ cards together form a subset of the 52-card deck with no duplicates.
**Objective**
Compute the maximum number of tricks that team NS (players N and S) can win under optimal play, where:
- Trick 1 is led by player N.
- Each trick is led by the winner of the previous trick.
- Players must follow suit if possible; otherwise, they may play any card.
- Trick winner is determined by:
- If any trump card is played, the highest-ranked trump wins.
- Otherwise, the highest-ranked card of the lead suit wins.
- Players play optimally to maximize NS’s trick count.