
function isLower(c)
	return string.lower(c) == c
end
function solve(s)
	if string.sub(s, 1, 1) ~= "A" then
		return false
	end
	if not isLower(string.sub(s, 2, 2)) or not isLower(string.sub(s, #s, #s)) then
		return false
	end
	local num = 0
	for i = 3, #s - 1 do
		local c = string.sub(s, i, i)
		if not isLower(c) then
			if num == 0 and c == "C" then
				num = 1
			else
				print(3, i)
				return false
			end
		end
	end
	if num == 0 then
		return false
	end
	return true
end
local s = io.read()
if solve(s) then
	print("AC")
else
	print("WA")
end