eolymp
bolt
Try our new interface for solving problems
Problems

Set of strings

Set of strings

Set of strings is given. Sort it according to their size. If the size of the strings are equal keep the original order of strings.

Input

First line contains number of tests. Each next line contains set of strings. Each string has no more than 50 characters ('a' - 'z').

Output

Print each set of strings in one line ordered by their length.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
ab cd e j asd ljffg df
a a b b c c
xy yx zxy zx xzy xxx
Output example #1
e j ab cd df asd ljffg
a a b b c c
xy yx zx zxy xzy xxx