Олимпиадный тренинг

Задача 38720. Sort by GPA


Print the last and first names of students in descending order of their GPA.

Input
First, the number of students n is given, then n lines, each of which contains the last name, first name and three numbers (grades in three subjects: mathematics, physics, computer science). The data in a line is separated by a single space. Ratings take a value from 1 to 5.

The total number of students does not exceed 100001.
Imprint
It is necessary to output pairs of surname-first name, one per line, separating the surname and first name with one space. No ratings required. If several students have the same average scores, then they should be output in the order specified in the input data.
 

Examples
# Input Output
1 2
Markov Valeriy 1 1 1
Ivanov Ivan 2 2 2
Ivanov Ivan
Markov Valeriy
2 3
Markov Valeriy 5 5 5
Sergey Petrov 1 1 1
Petrov Petr 3 3 3
Markov Valeriy
Petrov Petr
Sergey Petrov