
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    }

    private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    }

    private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        } S.charAt(0) == 'A' S.charAt(0) S.charAt S 0 'A' {
            System.out.println(judge(S) ? "AC" : "WA");
        } System.out.println(judge(S) ? "AC" : "WA") System.out.println System.out System System.out judge(S) ? "AC" : "WA" judge(S) judge S "AC" "WA" {
            System.out.println("WA");
        } System.out.println("WA") System.out.println System.out System System.out "WA" String[] args args private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    } judge {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    } for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        } char c str.toCharArray() str.toCharArray str {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        } {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        } for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            } int ct = 'D'; int ct = 'D'; ct 'D' ct <= 'Z' ct 'Z' ct++ ct++ ct {
                if (c == (char) ct) {
                    return false;
                }
            } {
                if (c == (char) ct) {
                    return false;
                }
            } if (c == (char) ct) {
                    return false;
                } c == (char) ct c (char) ct {
                    return false;
                } return false; false if (c == 'B') {
                return false;
            } c == 'B' c 'B' {
                return false;
            } return false; false str = str.substring(2) str str.substring(2) str.substring str 2 if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        } str.charAt(str.length() - 1) == 'C' str.charAt(str.length() - 1) str.charAt str str.length() - 1 str.length() str.length str 1 'C' {
            return false;
        } return false; false if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        } str.contains("C") str.contains str "C" {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } str = str.substring(0, str.length() - 1) str str.substring(0, str.length() - 1) str.substring str 0 str.length() - 1 str.length() str.length str 1 return (str.indexOf("C") == str.lastIndexOf("C")); (str.indexOf("C") == str.lastIndexOf("C")) str.indexOf("C") str.indexOf str "C" str.lastIndexOf("C") str.lastIndexOf str "C" {
            return false;
        } return false; false String str str public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    }

    private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    }

    private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    }
} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        if (S.charAt(0) == 'A') {
            System.out.println(judge(S) ? "AC" : "WA");
        } else {
            System.out.println("WA");
        }
    }

    private static boolean judge(String str) {
        for (char c : str.toCharArray()) {
            for (int ct = 'D'; ct <= 'Z'; ct++) {
                if (c == (char) ct) {
                    return false;
                }
            }
            if (c == 'B') {
                return false;
            }

        }
        str = str.substring(2);
        if (str.charAt(str.length() - 1) == 'C') {
            return false;
        } else if (str.contains("C")) {
            str = str.substring(0, str.length() - 1);
            return (str.indexOf("C") == str.lastIndexOf("C"));
        } else {
            return false;
        }
    }
}
