#K75737. Sort Filenames in Lexicographical Order

    ID: 34486 Type: Default 1000ms 256MiB

Sort Filenames in Lexicographical Order

Sort Filenames in Lexicographical Order

You are given multiple test cases, each containing a list of filenames. Your task is to sort these filenames in lexicographical order (case-sensitive) for each test case.

The input begins with an integer TT, the number of test cases. For each test case, the first line contains an integer NN representing the number of filenames followed by NN lines, each containing a filename. After sorting each test case's filenames, output them consecutively, one filename per line.

Note: The lexicographical order follows standard character encoding where uppercase letters are considered less than lowercase letters.

inputFormat

The first line contains an integer TT (1T1001 \leq T \leq 100) representing the number of test cases. For each test case, the first line contains an integer NN (1N10001 \leq N \leq 1000), and the next NN lines contain a filename each.

outputFormat

For each test case, output the sorted filenames in lexicographical order, one per line. The output for all test cases should be concatenated together without any additional spaces or blank lines.## sample

2
3
banana
Apple
cherry
4
Zebra
elephant
dog
Cat
Apple

banana cherry Cat Zebra dog elephant

</p>