

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;
    }
} import java.util.Scanner; Scanner java.util import java.util.regex.Pattern; Pattern java.util.regex 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;
    }
} Main static Scanner sc = new Scanner(System.in); 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");

    } main {
        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");

    } String s = sc.next(); s sc.next() sc.next sc boolean result = false; result false int indexC = s.indexOf("C"); indexC s.indexOf("C") s.indexOf s "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;
            }
        } "A".equals(s.substring(0, 1)) && indexC >= 2 && indexC <= s.length() - 2 && !onemoretime(s, 'C') indexC <= s.length() - 2 "A".equals(s.substring(0, 1)) && indexC >= 2 && indexC <= s.length() - 2 && !onemoretime(s, 'C') "A".equals(s.substring(0, 1)) "A".equals "A" s.substring(0, 1) s.substring s 0 1 indexC >= 2 indexC 2 indexC <= s.length() - 2 indexC s.length() - 2 s.length() s.length s 2 !onemoretime(s, 'C') onemoretime(s, 'C') 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;
            }
        } s = s.replace("A", "") s s.replace("A", "") s.replace s "A" "" s = s.replace("C", "") s s.replace("C", "") s.replace s "C" "" String pattern = "^[a-z]+$"; pattern "^[a-z]+$" Pattern p = Pattern.compile(pattern); p Pattern.compile(pattern) Pattern.compile Pattern pattern if (p.matcher(s).find()) {
                result = true;
            } p.matcher(s).find() p.matcher(s).find p.matcher(s) p.matcher p s {
                result = true;
            } result = true result true System.out.println(result ? "AC" : "WA") System.out.println System.out System System.out result ? "AC" : "WA" result "AC" "WA" String[] args args static boolean onemoretime(String str, char target) {
        return str.length() - str.replace(target + "", "").length() > 1;
    } onemoretime {
        return str.length() - str.replace(target + "", "").length() > 1;
    } return str.length() - str.replace(target + "", "").length() > 1; str.length() - str.replace(target + "", "").length() > 1 str.length() - str.replace(target + "", "").length() str.length() str.length str str.replace(target + "", "").length() str.replace(target + "", "").length str.replace(target + "", "") str.replace str target + "" target "" "" 1 String str str char target target 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;
    }
} 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;
    }
} Main


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;
    }
}
