FUCT_IF_CHKDATE - Date validation

Enter an unchecked date then check whether it is valid date.

Input

The first line of the input consist of a single integer number t which determines the number of tests.

In each of next t lines there is three numbers are month and day and year that separated by a space.

Constraints

  • 0 < t ≤ 1 000

Output

For each number n print out the checking status is "VALID" for valid date or INVALID for invalid date.

Separate your answers with a new line character.

Example

Input:
7
9 8 2018
3 39 2000
2 29 2018
20 -4 1998 
2 29 2000
7 31 1986 
11 31 2002

Output:
VALID
INVALID
INVALID
INVALID
VALID
VALID
INVALID

Added by:khanhvh
Date:2018-07-10
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:FPTU Can Tho

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.