#P437. 练76.1生日排序
练76.1生日排序
Description
At the beginning of the semester, the teacher wants to collect everyone's birthday and sort them from earliest to latest.
Input Format
The first line contains an integer (), representing the number of students in the class.
The next lines each contain a string and three integers , , , indicating that the student named was born on year month day.
All dates are guaranteed to be valid, and the name consists of lowercase letters and is no more than characters long.
Output Format
Output lines, each containing a string representing a name. If two students have the same birth date, the one who appears later in the input should be output first.
Sample
3
qwb 1996 6 30
gyt 1995 7 28
wc 1996 6 30gyt
wc
qwb