Personal files
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
One day, an awkward secretary messed up personal affairs of students. Now they again need to order first by grade, and within a class by name.
Input
The first line contains the number of personal affairs n (1 ≤ n ≤ 1000). Next to each of the n students the following data (each in its own line): full name, grade, date of birth. Surname and name - string of no more than 20 characters, the class - a string consisting of a number (from 1 to 11) and a letter (from "A" to "Z"), date of birth - the date in the format DD.MM.YY. It is guaranteed that there are no namesakes within the same class.
Output
Print n lines, each of which contains the data for one student. Rows should be arranged first by class and then by last name.
Examples
Input #1
Answer #1
Input #3
Answer #3
Submissions 7K
Acceptance rate 39%