| CodeRams Practice Problem Archive |
|---|
| Закончено |
You are given a shuffled deck of cards, and your task is to return them to sorted order. Sorted order involves the cards being sorted first by their numbers, and if their numbers are equal, being sorted by their suit. In the sorting, clubs comes before diamonds, which comes before hearts, which comes before spades. The deck may not be complete, i.e. some cards may be missing. Assume that aces are always the highest possible card for this problem.
The first line of input contains a single integer $$$n$$$ (1 < $$$n$$$ <= 52): the number of cards in the deck. The next line contains $$$n$$$ space-separated blocks, each representing a card. Each block will contain one character representing the value of the card, and a second character representing the suit of the card. No "10" cards will be given in the input.
Output $$$n$$$ space-separated blocks: the deck, after sorting is complete.
10 8C 7D QH QD QC KD 2H AD 3D 7H
2H 3D 7D 7H 8C QC QD QH KD AD
| Название |
|---|


