There are 52 playing cards in a pack, divided into suits, and, within suits, into denominations. The suits are (in order, lowest to highest) Clubs, Diamonds, Hearts and Spades, abbreviated C, D, H and S. The 13 denominations (or face values) are (from lowest to highest): 2, 3, 4, 5, 6, 7, 8, 9, 10 (T), Jack (J), Queen (Q), King (K) and Ace(A). A higher card will beat a lower card in the same suit, but will not usually beat any other card in a different suit. An exception to this is the
trump suit–if a suit is designated to be a trump suit (by whatever means the rules of the game allow), then any card of that suit will beat any card of any other suit.
撲克共有 52 張牌，總共有 4 種花色 (C < D < H < S, 梅花 < 方塊 < 紅心 < 黑桃)，每 1 種花色有 13 張牌，由小到大的點數分別是 2, 3, 4, 5, 6, 7, 8, 9, 10 (T), Jack (J), Queen (Q), King (K) and Ace(A)，點數大的可以勝過點數小的。在遊戲中可以選定
A simplified version of an old card game called Hearts is played as follows. The dealer deals cards clockwise, one by one, face downward, to four other players and himself, starting with the player on his left, who thus gets the first card, followed by the sixth, and so on, while the dealer gets the fifth card, followed by the tenth, and so on. When each player has 10 cards there will be two left–these are exposed and the suit of the one of higher denomination determines the trump suit. If there is a tie, then the highest ranking suit becomes the trump suit.
Hearts是一款早期的簡化版卡牌遊戲，總共有 5 名玩家，發牌者將會順時針從自己的左手邊第一個玩家依序發給每一個玩家，因此發牌者自己將會拿到第 5 張、第 10 張、 … 等。最後，每名玩家將會有 10 張牌，剩下的兩張牌點數高的那張牌的花色將是王牌花色，如果點數相同，則原本由原本花色大的被選為王牌花色。
game consists of 10
tricks, each containing 5 cards, one from each player. For each trick, one player
leads, i.e. plays a card face up on the table, the rest of the players then `follow’, in clockwise order. The player to the dealer’s left leads to the first trick, thereafter the winner of each trick leads to the next trick. A player must follow suit if possible, i.e. play a card of the same suit as the one lead. If he cannot, then he must trump it (play a card of the designated trump suit). If he cannot trump it (because he has no cards in the trump suit), he discards a card. If a trick is trumped, then the person playing the highest trump wins the trick, otherwise the person playing the highest card of the correct suit wins it.
這場遊戲共計 10 輪，每一輪每名玩家各出 1 張牌，因此共計 5 張。在每一輪中，將會有一名玩家擔任
Strategies are as follows:
- Leader: The leader always plays the highest card in his hand. If there is a tie and one of the cards is a trump card, then he leads the trump, otherwise he plays the highest ranking suit.
- Follower: If possible he must play the highest card in his hand of the correct suit. If he has no cards in that suit then he plays the highest trump he has. If he cannot trump it he plays the highest card in his hand, breaking ties as previously specified.
When all the tricks have been played, each player examines the tricks he has taken and scores the face value of any Heart he has (Jack counts 11, Queen counts 12, King counts 13 and Ace counts 14). This score is recorded.
在每一輪，獲勝者將會拿到該輪出牌 5 張中紅心的點數，並且加入到自己的得分中。
Write a program to simulate the playing of this game.
Input will consist of a series of decks of cards, each deck spread over four lines as shown below. The file will be terminated by a line consisting of a single #.
Output will consist of a series of lines, one for each deck in the input. Each line will consist of 5 numbers reflecting the scores of the individual players, starting with the dealer and proceeding clockwise through the rest of the players. Each score will consist of a number right justified in a field of width 3.