#Z15411. 生日相同
生日相同
Description
In a large class of students, the probability of two students sharing the same birthday is very high. Given each student's name and birth month and day,
find all students who share the same birthday.
Input Format
First line contains an integer , representing the number of students, where .
Each subsequent line contains a string and two integers, representing the student's name (first letter capitalized, rest lowercase, no spaces, length less than ) and birth month () and day ().
Name, month, and day are separated by a single space.
Output Format
For each group of students sharing the same birthday, output one line containing the month and day followed by all students born on that day, with numbers and names separated by a single space.
Output all groups in chronological order.
For students sharing the same birthday, output their names in order of increasing length, and for names of the same length, output them in alphabetical order.
If no students share the same birthday, output "None".
Sample
6
Avril 3 2
Candy 4 5
Tim 3 2
Sufia 4 5
Lagrange 4 5
Bill 3 23 2 Tim Bill Avril
4 5 Candy Sufia Lagrange