#t122. 密码强度

密码强度

Password Strength

Problem Description

Little Yang is a member of the school's cybersecurity club. Today his task is to design a "password strength checker" to help classmates see whether their passwords are secure enough. A secure password must satisfy the following:

  • At least 88 characters long (a too-short password is easy to guess!).
  • At least one uppercase letter (any of A, B, C, ..., Z).
  • At least one digit (any of 0, 1, 2, 3, ..., 9).

For example:

  • PAs1s2an is secure (8 characters, with uppercase P, A and digits 11, 22).
  • ab1da3cd is not secure (no uppercase letter).
  • Paabdbcd is not secure (no digit).
  • Pa2 is not secure (only 33 characters, too short).

Input Format

The first line contains a positive integer TT, the number of passwords to check.

For each password, one line contains a string: the password to check.

Output Format

For each password, output one line: if it meets the strength requirements output Y, otherwise output N.

Sample Input

6
PAs1s2an
1a2bCql3
Pa12bsna
ab1da3cd
Paabdbcd
Pa2

Sample Output

Y
Y
Y
N
N
N

Sample Explanation

There are 66 passwords to check, and the checker gives its verdict on each:

  • PAs1s2an has length 88, with uppercase P, A and digits 11, 22; satisfies all three conditions, so output Y.
  • 1a2bCql3 has length 88, with uppercase C and digits 11, 22, 33; satisfies all conditions, so output Y.
  • Pa12bsna has length 88, with uppercase P and digits 11, 22; satisfies all conditions, so output Y.
  • ab1da3cd has length 88 and has digits, but no uppercase letter; fails the uppercase requirement, so output N.
  • Paabdbcd has length 88 and has uppercase, but no digit; fails the digit requirement, so output N.
  • Pa2 has length only 33; fails the length requirement, so output N.

Constraints

For all test cases, 1≤T≤1001 \le T \le 100, each password has length ll with 1≤l≤1001 \le l \le 100, and consists only of uppercase letters, lowercase letters, and digits.