import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ks96neko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) BAcCepted solver = new BAcCepted(); solver new BAcCepted() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    } BAcCepted public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        } solve {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        } String r = in.next(); r in.next() in.next in int rl = r.length(); rl r.length() r.length r String r0 = r.substring(0, 1); r0 r.substring(0, 1) r.substring r 0 1 String a = "A"; a "A" String rb = r.substring(2, rl - 1); rb r.substring(2, rl - 1) r.substring r 2 rl - 1 rl 1 int c1 = rb.indexOf("C"); c1 rb.indexOf("C") rb.indexOf rb "C" int cn = rb.lastIndexOf("C"); cn rb.lastIndexOf("C") rb.lastIndexOf rb "C" if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            } a.equals(r0) a.equals a r0 {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                } c1 != -1 && cn != -1 c1 != -1 c1 -1 1 cn != -1 cn -1 1 {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    } c1 != cn c1 cn {
                        out.println("WA");
                    } out.println("WA") out.println out "WA" {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    } for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        } int i = 1; int i = 1; i 1 i < rl i rl i++ i++ i {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        } {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        } if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            } r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i)) r.charAt(i) != 'C' r.charAt(i) r.charAt r i 'C' Character.isUpperCase(r.charAt(i)) Character.isUpperCase Character r.charAt(i) r.charAt r i {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            } out.println("WA") out.println out "WA" return; out.println("AC") out.println out "AC" {
                    out.println("WA");
                } out.println("WA") out.println out "WA" {
                out.println("WA");
            } out.println("WA") out.println out "WA" int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ks96neko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAcCepted solver = new BAcCepted();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAcCepted {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String r = in.next();
            int rl = r.length();

            String r0 = r.substring(0, 1);
            String a = "A";

            String rb = r.substring(2, rl - 1);
            int c1 = rb.indexOf("C");
            int cn = rb.lastIndexOf("C");

            if (a.equals(r0)) {
                if (c1 != -1 && cn != -1) {
                    if (c1 != cn) {
                        out.println("WA");
                    } else {
                        for (int i = 1; i < rl; i++) {
                            if (r.charAt(i) != 'C' && Character.isUpperCase(r.charAt(i))) {
                                // System.out.println(i+"で　WA:なぜなら"+r.charAt(i)+"が大文字だから");
                                out.println("WA");
                                return;
                            }
                        }
                        out.println("AC");
                    }
                } else {
                    out.println("WA");
                }
            } else {
                out.println("WA");
            }
        }

    }
}

