Given N words ai of lowercase letters. Arrange these words such that word ai of length li comes before word aj of length lj if
1) li<lj.
OR
2) li=lj and the first different letter in ai < corresponding letter in aj. Letters are compared with respect to their ASCII Value.
For example: ai = "arm", aj = "ant", so "ant" comes before "arm" because second letter in aj n < second letter in ai r.
Input:
In the first line: Given an integer N.
In the second line: N strings ai follow.
Output:
Print the words in the order illustrated in the question.
Constraints:
1≤N≤100.
1≤li≤10.