

import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        String s = sc.next();
        boolean result = false;

        int indexC = s.indexOf("C");

        if ("A".equals(s.substring(0, 1)) && indexC >= 2 && indexC <= s.length() - 2 && !onemoretime(s, 'C')) {
            s = s.replace("A", "");
            s = s.replace("C", "");
            String pattern = "^[a-z]+$";
            Pattern p = Pattern.compile(pattern);
            if (p.matcher(s).find()) {
                result = true;
            }
        }
        System.out.println(result ? "AC" : "WA");

    }

    static boolean onemoretime(String str, char target) {
        return str.length() - str.replace(target + "", "").length() > 1;
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz