Eligibility

No attempts yetTime limit2sMemory limit256 MB

Problem

Every year students around the world enter the ACM ICPC. To enter the contest, a student must be eligible to compete. Given information about students, write a program that decides whether each student is eligible.

Assume every student already meets the basic requirements in the ICPC rules: the student is willing to compete at the World Finals, is a registered student with at least a 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 that decide whether a student may compete in the contest year 2014 to 2015 are these.

  1. If the student first began post-secondary studies in 2010 or later, the student is eligible.
  2. If the student was born in 1991 or later, the student is eligible.
  3. If neither rule above applies and the student has completed more than the equivalent of 8 semesters of full-time study, the student is ineligible.
  4. If none of the rules above applies, the coach may petition for an extension of eligibility by providing the student's academic history and work history.

One semester of full-time study counts as 5 completed courses. A student who has completed 41 courses or more therefore counts as having more than 8 semesters of full-time study.

Input

The input consists of a number of cases. The first line contains a positive integer, the number of cases that follow. Each case is given on one line in this format.

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

name is the name of the student and has up to 30 alphabetic characters. The first date is the date the student first began post-secondary studies, and the second date is the student's date of birth. Every date uses the format above, with a 4-digit year, a 2-digit month, and a 2-digit day. courses is a non-negative integer, the number of courses the student has completed.

There are at most 1000 cases.

Output

For each student, print the student's name, a space, and then one of the strings eligible, ineligible, and coach petitions, whichever applies.