lengthsort

Length Sort

Given a sequence of words, print them out from the longest word to the shortest word. In the event the number of letters are the same, print the word that appeared in the sequence first. The number of words are not more than 1000 and its length not exceeding 10000.

Input

Input consists of a single integer, n. n denotes the number of words in the sequence provided.

After the first line, n lines of words are given, with one word on each line. These words are the words in the sequence.

Sample Input

5
Hello
Kitty
is
Nice
Right

Sample Output

Hello
Kitty
Right
Nice
is


Submitting .cpp to 'lengthsort'


You're not logged in! Click here to login

Time Limit: 1 Seconds
Memory Limit: 1024MB
Your best score: 0
Source: Dunjudge Archive

Subtask Score
1 100
2 0