#K47222. Valid Book Code Checker

    ID: 28151 Type: Default 1000ms 256MiB

Valid Book Code Checker

Valid Book Code Checker

Given a book code as input, determine if it is valid based on the following rules:

  1. The code must be exactly 8 characters long, i.e. ( |code| = 8 ).
  2. The first two characters must be uppercase English letters ( [A-Z] ).
  3. The next four characters must be digits ( [0-9] ).
  4. The last two characters must be lowercase English letters ( [a-z] ).

For example, the code AB1234cd is valid while ABC1234d is not.

Your task is to write a program that reads a book code from standard input and prints True if the code meets all the rules, or False otherwise.

inputFormat

The input consists of a single line containing a string that represents the book code.

outputFormat

Print a single line: True if the input code is valid according to the rules, and False otherwise.## sample

AB1234cd
True

</p>