import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char[] a = s.toCharArray(); a s.toCharArray() s.toCharArray s int flag = 0; flag 0 if(a[0] != 'A'){
            flag++;
        } a[0] != 'A' a[0] a 0 'A' {
            flag++;
        } flag++ flag int flag2 = 0; flag2 0 for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        } int i = 1; int i = 1; i 1 i<a.length i a.length a a.length i++ i++ i {
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        } {
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        } if(Character.isUpperCase(a[i])){
                flag2++;
            } Character.isUpperCase(a[i]) Character.isUpperCase Character a[i] a i {
                flag2++;
            } flag2++ flag2 if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        } s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length() s.indexOf("C") == 1 s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length() s.indexOf("C") != s.lastIndexOf("C") s.indexOf("C") s.indexOf s "C" s.lastIndexOf("C") s.lastIndexOf s "C" s.indexOf("C") == 0 s.indexOf("C") s.indexOf s "C" 0 s.indexOf("C") == 1 s.indexOf("C") s.indexOf s "C" 1 s.lastIndexOf("C")+1 == s.length() s.lastIndexOf("C")+1 s.lastIndexOf("C") s.lastIndexOf s "C" 1 s.length() s.length s {
            flag++;
        } flag++ flag if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        } flag == 0 && flag2 == 1 flag == 0 flag 0 flag2 == 1 flag2 1 {
            System.out.println("AC");
        } System.out.println("AC") System.out.println System.out System System.out "AC" {
            System.out.println("WA");
        } System.out.println("WA") System.out.println System.out System System.out "WA" String[] args args public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] a = s.toCharArray();

        int flag = 0;
        if(a[0] != 'A'){
            flag++;
        }
        int flag2 = 0;
        for(int i = 1;i<a.length;i++){
            if(Character.isUpperCase(a[i])){
                flag2++;
            }
        }
        if(s.indexOf("C") != s.lastIndexOf("C") || s.indexOf("C") == 0 || s.indexOf("C") == 1 || s.lastIndexOf("C")+1 == s.length()){
            flag++;
        }

        if(flag == 0 && flag2 == 1){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
}