Black Jack is a card game in which you try to hold cards worth no more than 21. Casinos play it for money, but this version has no money at stake and only counts wins.
A pack holds 52 cards, four of each of 13 values. Cards are worth the following.
The rules are these.
Several scenarios are given. One scenario takes two lines.
The first line holds the 52 card values of one pack in the order they are dealt, written with no spaces. Each character is one of A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K, and each value appears exactly four times.
The second line holds 1 to 5 player names separated by single spaces. A name contains no spaces.
The last line holds # alone. That line is not processed.
Print one line per scenario. Write the player names in the order given in the input, each followed by that player's number of wins, then dealer followed by the dealer's number of wins. Separate names and numbers with single spaces.