#K8481. Password Strength Checker

    ID: 36502 Type: Default 1000ms 256MiB

Password Strength Checker

Password Strength Checker

You are given a list of passwords. For each password, determine whether it meets all of the following security criteria:

  • The password must be at least 8 characters long.
  • It must contain at least one lowercase letter.
  • It must contain at least one uppercase letter.
  • It must contain at least one digit.
  • It must include at least one special character from the set \(\{!, @, #, $, %, ^, &, *, (, ), _, +\}\).

For each password, output "Valid" if it meets all the criteria and "Invalid" otherwise.

inputFormat

The input is given from standard input (stdin) and has the following format:

T
password_1
password_2
...
password_T

Where T is an integer representing the number of passwords, and each of the following T lines is a password string.

outputFormat

For each password, print a single line containing either "Valid" or "Invalid" indicating whether the password meets the security criteria.

## sample
3
Password1@
GoodPa$$word123!
V4l!d*Pwd
Valid

Valid Valid

</p>