Go Back
Vishal's Journey (100)
Description

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)

Input

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.

Output

T lines of output stating whether the given password is Valid or Invalid.

Constraints

1<=T<=100
1<=String length<=50

Example
Copy Input

Input:
4
Welcome123
123Welcome
welcome123
Welc1
Output:
Valid
Invalid
Invalid
Invalid

Explanation

Case 1:
All the conditions for the password are satisfied. Hence, it is Valid.
Case 2:
The password starts with a number. Hence, it is Invalid.
Case 3:
The password doesn’t contain an uppercase character. Hence, it is Invalid.
Case 4:
The length of the password is less than 8. Hence, it is invalid.

September Queue
36 hour long contest



Announcement
01:40 PM: Check your submission to see details about CE or RTE
12:28 PM: In Problem D, all the numbers are in single line for each test
Tips and Tricks for Python: Visit Here
Tips and Tricks for C++: Visit Here
Tips and Tricks for Java: Visit Here

Problem Tags
strings

Supported by our Coding Partner