#C7130. Valid Pattern Checker
Valid Pattern Checker
Valid Pattern Checker
You are given a string pattern. A pattern is considered valid if it meets the following conditions:
- The pattern is empty, or
- The pattern starts with (A) and ends with (C) with exactly one (B) between them.
Formally, a non-empty string (s) is valid if and only if (s = A;B;C). An empty string is also considered valid.
Your task is to determine whether the given pattern is valid.
inputFormat
Input consists of a single line containing the string pattern. The string may be empty.
outputFormat
Output a single line containing either (True) if the pattern is valid, or (False) otherwise.## sample
ABC
True