#K38777. Valid Message Checker

    ID: 26274 Type: Default 1000ms 256MiB

Valid Message Checker

Valid Message Checker

You are given a string s. Your task is to determine whether it is a valid message based on the following rules:

  • The number of 'B's in s must be at most one, i.e., $$\#B \leq 1$$.
  • The number of 'C's in s must be at most two, i.e., $$\#C \leq 2$$.

If both conditions are satisfied, output True; otherwise, output False.

Examples:

  • For s = "AAC", the output should be True.
  • For s = "BBC", the output should be False.
  • For s = "CCCC", the output should be False.

inputFormat

The input consists of a single line containing the string s.

outputFormat

Output a single line: True if the string s is a valid message according to the rules, otherwise False.

## sample
AAC
True