Doudizhu is a very popular poker card game.
It has three players, two of them are Farmers, Farmer has 17 cards and the third
player is Dizhu, Dizhu has 20 cards. Cuperman likes Doudizhu, but he is lazy,
he does not want to sort cards in his hand. One day, when he is playing
Doudizhu with Lucy and Lily, he asked Huang Bo to sort his cards by the
following order:** Red joker is the left
most one, and White joker will be the second one. Then sort the cards by the
number of cards Cuperman has. If the number of cards are the same, sort them as
the follow order: Red joker > White joker > 2 > A > K > Q > J
> 10 > 9 > 8 > 7 > 6 > 5 > 4 >3.** For example, if he
not a Dizhu, he has Red joker, four K, three 2, four 9, one A, two 6, two 5,
the order will be

Red joker K K K K 9 9 9 9 2 2 2 6 6 5 5 A

As we all know, Huang Bo is TA of CS203, he asks the students in his course to help him.