#K86927. Password Validator

    ID: 36973 Type: Default 1000ms 256MiB

Password Validator

Password Validator

In this problem, you are required to validate a list of passwords against a set of strict criteria. A password is deemed valid if and only if it meets all of the following conditions:

  1. Its length is at least 88 characters (i.e., password8|password| \ge 8).
  2. It contains at least one uppercase letter (matching pattern [A-Z]).
  3. It contains at least one lowercase letter (matching pattern [a-z]).
  4. It includes at least one digit (matching pattern [0-9]).
  5. It contains at least one special character from the set: \{!@#\$%\^&\*()\-+\}.

Input will be provided via standard input (stdin) and the result should be printed to standard output (stdout). Each password’s validity should be output as either "valid" or "invalid" on a separate line.

inputFormat

The first line of input contains a single integer NN, representing the number of passwords. Each of the following NN lines contains one password string.

outputFormat

Output NN lines, each containing either "valid" or "invalid", corresponding to whether the respective password meets all the requirements.## sample

7
Passw0rd!
password
P@ssw0rd
short!
A1@a
Aa1@bcdefghijklmnop
12345Aa!
valid

invalid valid invalid invalid valid valid

</p>