(defn AcCepted [S]
  (let [tmp (remove #(Character/isLowerCase %) (drop-last (drop 2 S)))]
    (if (and
          (= \A (first S))
          (Character/isLowerCase (second S))
          (Character/isLowerCase (last S))
          (= 1 (count tmp))
          (= \C (first tmp)))
      "AC"
      "WA")))

(-> (read-line) AcCepted println)