Woburn Challenge 2016-17 Round 2 - Junior Division

Lieutenant B'Elenne Terres is one unsatisfied Klingon. Her engineering working aboard the Starship Enterprise is all well and good, but what she really needs is a mate!
Fortunately for her, the Enterprise has happened across a Klingon
colony, which has
Any warrior who has lost at least one battle would clearly not make a
suitable mate - weakness is unacceptable. Of the warriors who have never
lost any battles, the perfect mate is the one who has won the greatest
number of battles. If multiple suitable warriors have won the same
number of battles, then the one earliest in the list of
Please help Terres determine the name of this perfect mate! Of course,
it's also possible that there's no such mate, if none of the
Input Specification
The first line of input consists of a single integer
Output Specification
Output a single line consisting of a single string - either the name of
the perfect mate, or None
if there are no suitable mates.
Sample Input 1
5
Mereg 7 0
Werf 15 10
Kehless 14 0
Kerek 14 0
Stex 2 3
Sample Output 1
Kehless
Sample Input 2
1
Jacob 100 1
Sample Output 2
None
Comments