Eligibility#7527

Eligibility

1 secondo
122,174 megabyte
Molto facile

Every year, students across the world participate in the ACM ICPC. In order to participate in this contest, a student must be eligible to compete. In this problem, you will be given information about students and you will write a program to determine their eligibility to participate in the ICPC.

We will start by assuming that each student meets the "Basic Requirements" as specified in the ICPC rules - the student is willing to compete at the World Finals, is a registered student with at least half-time load, competes for only one institution in a contest year, and has not competed in two world finals or five regional contests.

The rules to decide if a student is eligible to compete in the contest year - are as follows:

  1. if the student first began post-secondary studies in or later, the student is eligible;

  2. if the student is born in or later, the student is eligible;

  3. if none of the above applies, and the student has completed more than an equivalent of semesters of full-time study, the student is ineligible;

  4. if none of the above applies, the coach may petition for an extension of eligibility by providing the student's academic and work history.

For "equivalent of semesters of full-time study", we consider each semester of full-time study to be equivalent to a student completing courses. Thus, a student who has completed courses or more is considered to have more than semesters of full-time study.

Input

Consists of a number of cases. The first line contains a positive integer, indicating the number of cases to follow. Each of the cases is specified in one line in the following format

name YYYY/MM/DD YYYY/MM/DD courses

where name is the name of the student (up to alphabetic characters), the first date given is the date thestudent first began post-secondary studies, and the second date given is the student's date of birth. All dates are given in the format above with -digit year and -digit month and day. courses is a non-negative integer indicating the number of courses that the student has completed. There are at most cases.

Output

For each line print the student's name, followed by a space, followed by one of the strings eligible, ineligible, and coach petitions as appropriate.

Esempi

Esempio 1

Loading
Loading