Xedni Drawkcab

Reverse each uppercase word and print the reversed words in alphabetical order.

Easy3StringSortingInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

Before computers, Merriam Webster kept a backward index of every word in the English language. Each word sat on its own card, spelled backwards, and the cards were filed in alphabetical order. The index answered questions such as "how many words end in TION?".

You are given a list of words written in capital letters only. Build a backward index: reverse every word, then print the reversed words in alphabetical order.

Input

The first line contains an integer nn (1n10001 \le n \le 1000), the number of words. Each of the next nn lines contains one word. Every word is 1 to 100 letters long and consists of capital letters only. There are no spaces and no blank lines.

Output

Print the reversed words in alphabetical order, one per line. A word that appears several times in the input is printed that many times.