#K37507. Serial Number Validation
Serial Number Validation
Serial Number Validation
This problem requires you to validate a series of serial numbers according to the following criteria:
- The serial number must contain at least two different digits. In mathematical terms, if S is the set of digits of the serial, then \(|S| \geq 2\).
- The serial number must not contain any two consecutive identical digits.
Your task is to read several serial numbers from standard input and determine for each serial number whether it is "Valid" or "Invalid" based on the criteria above.
For example, consider the serial number "120120". It contains at least two different digits and no two identical digits are adjacent, so it is valid.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains a single integer \(T\) denoting the number of serial numbers.
- The following \(T\) lines each contain a serial number (a non-empty string of digits).
outputFormat
For each serial number read from the input, output a single line to standard output (stdout) containing either "Valid" if the serial number meets the specified conditions or "Invalid" otherwise.
## sample4
12345
11111
112233
120120
Valid
Invalid
Invalid
Valid
</p>