beecrowd | 1244

Sort by Length

By TopCoder* USA

Timelimit: 1

Create a program to sort a set of strings by their size. Its program is to receive a set of strings and return by this same size ordered set of words, if the size of the strings are equal, must maintain the original order of the set.

Input

The first line of input has a unique integer N that indicates the number of sets of strings, each set may contain between 1 and 50 inclusive elements, and each of the strings of the set may contain between 1 and 50 inclusive characters.

Output

The output should contain the set of input strings ordered by the length of strings.A blank space must be printed between two words.

Sample Input Sample Output

4
Top Coder comp Wedn at midnight
one three five
I love Cpp
sj a sa df r e w f d s a v c x z sd fd

midnight Coder comp Wedn Top at
three five one
love Cpp I
sj sa df sd fd a r e w f d s a v c x z