Sort in reverse order#11299

Sort in reverse order

1 second
128 megabytes
Easy

A set of words is given. Sort them according to the following rule.

We say that a string is less than a string if the reverse of is lexicographically smaller than the reverse of . In other words, a < b if reverse(a) < reverse(b), where is the string-reversal operation.

For example,

Therefore, it holds that "" < "", since "" < "".

In addition, there is a special word "ADAUniversity", which must always appear at the beginning of the sorted list, regardless of the comparison result.

The sorting must be stable, meaning that for words with identical keys, their relative order must remain unchanged.

Input

Contains a text consisting of a set of words. Each word consists of Latin letters (uppercase or lowercase). Only spaces may appear between the words. The number of words does not exceed , and the length of each word is at most  characters.

Output

Print all the words sorted according to the described rule. Each word should be printed on a separate line.

Examples

Example 1

Loading
Loading