#K3881. Product Name Validator

    ID: 26281 Type: Default 1000ms 256MiB

Product Name Validator

Product Name Validator

You are given a list of product names. Each product name must adhere to a specific naming convention: it must start with an uppercase English letter, followed by exactly three digits, and end with exactly two English letters (case-insensitive for the last two letters). For instance, A123Bc is valid while A12Bc or abc123YZ is invalid.

The naming rule in LaTeX is: $$[A-Z][0-9]{3}[A-Za-z]{2}$$.

Your task is to write a program that reads a series of product names and prints "Valid" if the product name matches the convention and "Invalid" otherwise.

inputFormat

The first line of input contains an integer TT denoting the number of product names. Each of the next TT lines contains a single product name.

outputFormat

For each product name, output a single line with the word "Valid" if the product name follows the naming convention, or "Invalid" if it does not.## sample

4
A123Bc
X567yz
2fgHJ
Q890de
Valid

Valid Invalid Valid

</p>