An EC number is, just like a CAS number, a unique identification number assigned to chemicals that are commercially available in the European Union. These numbers have been assigned by the Italy-based European Chemicals Bureau (ECB) since January 1, 1993. The list of chemicals to which an EC number has been assigned is called the EC Inventory, and is further broken down into the following categories:

  1. The European Inventory of Existing Commercial Chemical Substances (EINECS) is a list of chemicals, polymers are not taken into account, which were commercially available in the EU from 1 January 1971 to 18 September 1981 The identification number of such substances is called an EINECS. EINECS numbers start from 200-001-8 (formaldehyde). This is also the smallest possible EC number.

  2. The European List of Notified Chemical Substances (ELINCS) is a list of chemicals that were commercially available in the EU after 18 September 1981. The identification number of such substances is called an ELINCS. ELINCS numbers start from 400-010-9 (commercial name: Indosol yellow SF-2RL).

  3. In April 1992, the definition of polymers was changed. This meant that chemicals that were previously considered as polymers were no longer excluded from the EU legislation. As a result, a list of "No-longer Polymers" "(NLP) was drawn, which contains chemicals that were commercially available between 18 September 1981 and 31 October 1993. The identification number of such substances is called an NLP number. NLP numbers start from 500-001-0 (2-methylpropene, trimers).

An EC number is a seven-digit code that is displayed as $$C_1C_2C_3-C_4C_5C_6-R$$. $$R$$ is a check digit and every $$C_i$$ ($$1\leq i\leq 6$$) is a number. The check digit is calculated using the ISBN method. According to this method, the check digit should be equal to the remainder after division by 11 of the following sum: \[ C_1 + 2\times C_2 + 3\times C_3 + 4\times C_4 + 5 \times C_5 + 6\times C_6 \] Consequently, 200-003-9 is a valid EC number, as \[ 2+2\times 0+3\times 0+4\times 0+5\times 0+6\times 3=20=1\times 11+9 \] If the remainder $$R$$ equals 10, then this combination of numbers is not used as an EC number.

Input

The first line of the input contains an integer t that describes the number of test cases. On the following t lines there is always a string that is passed off as an EC number.

Output

Write a line of text to the output for each test case, containing the EC number as given in the input and one of the following announcements depending on the type: EINECS number, ELINCS number, NLP number or invalid number. Both must be separated by a single space. A test case is invalid if at least one of the following conditions is met:

Try to keep the number and expression of the conditions that must be tested to determine the result as concise as possible.

Example

Input:

5
245-261-3
245-261-4
400-010-09
400-x10-9
abc

Output:

245-261-3 EINECS number
245-261-4 invalid number
400-010-09 invalid number
400-x10-9 invalid number
abc invalid number