Vishal wants to visit his native place in Ratnagiri to celebrate the festival of Ganesh Chaturthi. He wants to book a railway ticket to Ratnagiri, but found that the queue at the railway stations are too long. He decided that he will book the tickets online. However, he has to register himself first.
Vishal needs a strong password to help finish his registration process. But, the online portal has certain conditions for validating the password. The password is accepted as valid only if it follows the following set of rules:
a. The length of the password should be between 8 & 20, both inclusive
b. The password should have at least one lowercase character (a-z)
c. The password should have at least one uppercase character (A-Z)
d. The password should have at least one number (0-9)
e. The password should not start with a number
Help Vishal find out if his password is valid or not. Assume that NO special characters are used.
Output “Valid” if the password is valid and “Invalid” if it is invalid. (Do not print the quotes)
The first line of the input is an integer T, denoting the number of test cases
The next T lines contain a string, denoting Vishal’s password.
T lines of output stating whether the given password is Valid or Invalid.
All the conditions for the password are satisfied. Hence, it is Valid.
The password starts with a number. Hence, it is Invalid.
The password doesn’t contain an uppercase character. Hence, it is Invalid.
The length of the password is less than 8. Hence, it is invalid.