Sorting Strings


In this problem, you will sort a list of lowercase character strings according to the following ordering rules. In the following, let str1 and str2 be two strings.

Input specification:

Your program should read from stdin, a series of lists. Each list starts with a number n of strings to be read, on a line by itself, followed by a single string per line. Your program should stop reading lists at the end-of-file.

Output specification:

Your program output should print the string "List #k:" (where k is the current list number) and then in the following lines, it should print the strings in ascending order, in left-aligned columns, with the width of each column being two characters long than the longest occurring string in that list. Lists should be separated by a single blank line. Each line is limited to 80 characters.

Sample input:

10
albacore
albatross
vermeil
panacea
apparate
parmesan
candelabra
fanfare
false
beans
8
netherlands
pastiche
commensurate
pomade
triumvirate
plus
principia
zero
(EOF)

Sample ouput:

List #1
apparate      fanfare         panacea      albatross   albacore            false 
parmesan     candelabra  beans          vermeil 

List #2
pastiche          netherlands       zero              principia       triumvirate 
pomade          commensurate  plus

(end of ouput; prior empty line part of output)