You are given the name and the Korean, English, and math scores of N students. Write a program that sorts the students by the following rules, applied in order.
Names are compared by ASCII value. An uppercase letter has a smaller value than a lowercase letter, so it comes first.
The first line contains the number of students N (1≤N≤100000).
Each of the next N lines contains a student's name and Korean, English, and math scores, separated by single spaces. Every score is a natural number between 1 and 100. A name consists only of uppercase and lowercase letters and is at most 10 characters long. Two or more students may share the same name.
Print the name of each student on its own line, N lines in total, in the sorted order.