 CHARACTER(20) S
READ*,S
IF (S(1:1)/="A".or. S(3:3)/="C")THEN
  PRINT"(A)","WA"
  STOP
ENDIF
S(1:1)="a"
S(3:3)="c"
DO I=1,LEN_TRIM(S)
  IF(ICHAR(S(I:I))<ICHAR("a"))THEN
      PRINT"(A)","WA"
  STOP
  ENDIF
END DO
PRINT"(A)","AC"
END 