Time limit
2s
Memory limit
128 MB
Dasom owns many guitars, and each guitar has a different serial number. To find the right guitar quickly, she wants to sort the guitars by serial number.
Every serial number consists only of uppercase English letters (A-Z) and digits (0-9).
Serial number A comes before serial number B by the following rules:
A and B have different lengths, the shorter serial number comes first.Given the serial numbers, write a program that prints them in sorted order.
The first line contains the number of guitars, N. N is at most 50.
Each of the next N lines contains one serial number. The length of each serial number is at most 50, and each serial number consists only of uppercase English letters or digits. No two serial numbers are the same.
Print the sorted serial numbers, one per line, over N lines.