#P1104. 生日
生日
Description
cjf wants to collect the birthdays of every student in the school OI group and sort them by age in descending order (older first). However, cjf has a lot of homework recently and has no time, so please help her sort them.
Input Format
The input contains lines.
The first line contains the total number of people in the OI group.
Lines to each contain one person's name , birth year , month , and day .
Output Format
Output lines.
Print the names of the students in descending order of age. (If two students share the same birthday, print the one that appears later in the input first.)
3
Yangchu 1992 4 23
Qiujingya 1993 10 13
Luowen 1991 8 1
Luowen
Yangchu
Qiujingya
Hint
It is guaranteed that and . The given dates are valid, and the year .
Translated by ChatGPT 5
京公网安备 11011102002149号