#Z15411. 生日相同

生日相同

Description

In a large class of 180180 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 nn, representing the number of students, where n180n \le 180.
Each subsequent line contains a string and two integers, representing the student's name (first letter capitalized, rest lowercase, no spaces, length less than 2020) and birth month (1m121 \le m \le 12) and day (1d311 \le d \le 31).
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 2
3 2 Tim Bill Avril
4 5 Candy Sufia Lagrange