Rancho has best IQ in his class. Chatur being jealous of him gives him the task to produces new Sudoku sets. Sudoku set is the nine by nine matrix such a that its each row, column and three by three sub-matrix (denoted by different colors) has 1,2,3,4,5,6,7,8,9 each of them exactly once.
As per given task, Rancho is back with ‘t’ Sudoku sets. Now Chatur, being busy preparing for the
ESE Exam asks you to help him check whether the given sets are valid or invalid.
Output ‘VALID’ (without quotes) if it is valid Sudoku set otherwise output ‘INVALID’ (without quotes)
Input Format:
First Line contains the ‘t’ ,i.e. the no. of testcases
Next subsequent lines contain the nine by nine set
Output Format:
Each line corresponding to the Sudoku set whether it is VALID or INVALID
Constraints
Self Explanatory