the company uses a system for evaluating employees according to various criteria. For each employee, his assessments are known for several parameters. It is necessary to create a function -generator that will return employees in decreasing their average assessment, but with memory optimization - processing data on one employee at a time.
Input format
The first line contains the number of N. The following are n lines, each contains the name of the employee and its assessment through the gap. The name consists of one word, assessment - integers from 1 to 10
Output format
the names of employees in the order of descending an average grade, each name on a new line. With the equality of average assessments, sorting by alphabet
Example
Input
3
Ivan 8 9 7
Maria 9 10 8
Peter 6 7 8
Hint
There will be no clue here, decide for yourself!