Sort the people#10263

Sort the people

1 secondo
128 megabyte
Facile

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 n~(1 \le n \le 100). Each of the next lines contains name, surname and year of birth of one person. Name and surname contain no more than characters.

Output

Print the data about people according to the sorting condition.

Esempi

Esempio 1

Loading
Loading