Sort the people
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are people, each has a name, a surname and a year of birth. Sort them first lexicographically by surname, then by name. If there are several people with the same surname and name, then arrange them in descending order of their year of birth.
Input
The first line contains the number of people . Each of the next lines contains name, surname and year of birth of one person. Name and surname contain no more that characters.
Output
Print the data about people according to the sorting condition.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 56%