#K76812. Validate Group Codes

    ID: 34726 Type: Default 1000ms 256MiB

Validate Group Codes

Validate Group Codes

You are given a list of group codes. Your task is to determine whether each group code is valid. A valid group code must follow the pattern of three uppercase letters followed by four digits. In other words, a group code must match the regular expression: $$^[A-Z]{3}\d{4}$$.

For example, the code "ABC1234" is valid, while "AB12345", "abc1234", and "1234ABC" are not.

inputFormat

The first line of input contains an integer N, representing the number of group codes. Each of the following N lines contains a single group code as a string.

outputFormat

For each group code read from input, output a single line containing either "True" if the code is valid, or "False" otherwise.## sample

3
ABC1234
XYZ5678
DEF9101
True

True True

</p>