#K73442. Passcode Security Check

    ID: 33976 Type: Default 1000ms 256MiB

Passcode Security Check

Passcode Security Check

You are given several passcodes and your task is to check whether each passcode meets the minimum security requirements. A secure passcode must satisfy all of the following conditions:

  • It contains at least one upper-case letter.
  • It contains at least one lower-case letter.
  • It contains at least one digit.
  • It contains at least one special symbol (i.e. a character that is not alphanumeric).

In other words, given a passcode string s, you must verify the properties: \[ \exist_{c \in s} \; \text{isUpper}(c), \quad \exist_{c \in s} \; \text{isLower}(c), \quad \exist_{c \in s} \; \text{isDigit}(c), \quad \exist_{c \in s} \; \lnot \text{isAlnum}(c). \]

The program should read the input from stdin and write the output to stdout.

inputFormat

The input consists of multiple lines:

  1. The first line contains an integer N representing the number of passcodes.
  2. The next N lines each contain one passcode.

Input should be read from stdin.

outputFormat

For each passcode, output a single line with either PASS if it meets the security requirements, or FAIL otherwise. The results should be printed to stdout, one per line in the same order as the input passcodes.

## sample
1
A1a!
PASS

</p>