A backup tool holds n file labels, each a non-empty string of lowercase English letters and digits (no spaces). Sort the labels so that a shorter label comes before a longer one. Labels of the same length are ordered lexicographically (by ordinary character comparison, where digits 0-9 come before letters a-z). Duplicate labels are allowed and simply appear together.
Input format
Line 1: an integer n.
The next n tokens (each on its own line) are the file labels.
Output format
The n labels, one per line, in the sorted order described above.
Constraints
- 1 ≤ n ≤ 100000
- Each label has length 1..50 and contains only lowercase letters and digits.