At some university, applicants passed a preliminary test, according to the results of which they can be admitted to the entrance exams in the first stream. Testing is carried out in two subjects. For each subject, an applicant can score from 0 to 100 points. At the same time, applicants who have scored at least 30 points in each of the two subjects according to the test results are allowed to take exams in the first stream.
The input of the program is information about the results of preliminary testing. It is known that the total number of test participants does not exceed 500.
The first line contains the number of applicants who took part in the test, N
. This is followed by N
lines with the following format:
<Lastname> <Name> <Points>
,
where <last name> – a string of no more than 20 characters;
<Name> – a string of no more than 15 characters;
<Points> – a string containing two space-separated integers – scores obtained on testing in each of the two subjects.
At the same time, <Surname> and <Name>, <Name> and <Points> separated by one space.
Input string example:
Write a program that will display the last names and first names of applicants who failed, that is, were not allowed to take exams in the first stream. With this surname should be displayed in alphabetical order.