AtCoder Beginner Contest 104
B
AcCepted
AtCoder
⌀ 188
原题
← AC →
翻译中…

Problem Statement

翻译中…

You are given a string $S$. Each character of $S$ is uppercase or lowercase English letter. Determine if $S$ satisfies all of the following conditions:

翻译中…
  • The initial character of $S$ is an uppercase A.
  • There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
  • All letters except the A and C mentioned above are lowercase.
翻译中…

Constraints

翻译中…
  • $4 ≤ |S| ≤ 10$ ($|S|$ is the length of the string $S$.)
  • Each character of $S$ is uppercase or lowercase English letter.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

If $S$ satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.

翻译中…

样例

Input #1
AtCoder
Output #1
AC
The first letter is `A`, the third letter is `C` and the remaining letters are all lowercase, so all the conditions are satisfied.
Input #2
ACoder
Output #2
WA
The second letter should not be `C`.
Input #3
AcycliC
Output #3
WA
The last letter should not be `C`, either.
Input #4
AtCoCo
Output #4
WA
There should not be two or more occurrences of `C`.
Input #5
Atcoder
Output #5
WA
The number of `C` should not be zero, either.
题目信息
题号
abc104_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。