Your task is to write a program that reads a sequence of words and prints them in alphabetical order.
The input starts with a natural number and continues with the words that your program must sort. All the words are formed exclusively by lowercase letters.
The output is a line with the words of the input in alphabetical order, separated by a comma.
You must use the algorithm selection sort to solve this problem. Any other method will be qualified with a zero.
Input
3 helen george john
Output
george,helen,john
Input
11 a bird in the hand is worth two in the bush
Output
a,bird,bush,hand,in,in,is,the,the,two,worth
Input
7 a az b b bz z za
Output
a,az,b,b,bz,z,za
Input
0
Output
Input
1 hello
Output
hello