import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int size = str.length();

        if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        }
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int size = str.length();

        if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int size = str.length();

        if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int size = str.length();

        if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int size = str.length(); size str.length() str.length str if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        } "A".equals(str.substring(0,1)) "A".equals "A" str.substring(0,1) str.substring str 0 1 {
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        } int num =0; num 0 String str2 = str.substring(2,size-1); str2 str.substring(2,size-1) str.substring str 2 size-1 size 1 int size2 = str2.length(); size2 str2.length() str2.length str2 for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            } int i=0; int i=0; i 0 i<size2 i size2 i++ i++ i {
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            } {
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            } String str4 = str2.substring(0,1); str4 str2.substring(0,1) str2.substring str2 0 1 if(str4.equals("C")){
                    num = num+1;
                } str4.equals("C") str4.equals str4 "C" {
                    num = num+1;
                } num = num+1 num num+1 num 1 str2 = str2.substring(1) str2 str2.substring(1) str2.substring str2 1 if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            } num==1 num 1 {
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            } str2 = str.substring(2,size-1) str2 str.substring(2,size-1) str.substring str 2 size-1 size 1 str2 = str2.replace("C","c") str2 str2.replace("C","c") str2.replace str2 "C" "c" str2 = str2.concat(str.substring(str.length() -1)) str2 str2.concat(str.substring(str.length() -1)) str2.concat str2 str.substring(str.length() -1) str.substring str str.length() -1 str.length() str.length str 1 str2 = str.substring(1,2).concat(str2) str2 str.substring(1,2).concat(str2) str.substring(1,2).concat str.substring(1,2) str.substring str 1 2 str2 String str3 = str2.toLowerCase(); str3 str2.toLowerCase() str2.toLowerCase str2 if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                } str2.equals(str3) str2.equals str2 str3 {
                    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" {
                System.out.println("WA");    
            } System.out.println("WA") System.out.println System.out System System.out "WA" {
            System.out.println("WA");
        } System.out.println("WA") System.out.println System.out System System.out "WA" String[] args args
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int size = str.length();

        if("A".equals(str.substring(0,1))){
            int num =0;
            String str2 = str.substring(2,size-1);
            int size2 = str2.length();
            for(int i=0;i<size2;i++){
                String str4 = str2.substring(0,1);
                if(str4.equals("C")){
                    num = num+1;
                }
                str2 = str2.substring(1);
            }
            if(num==1){
                str2 = str.substring(2,size-1);
                str2 = str2.replace("C","c");
                str2 = str2.concat(str.substring(str.length() -1));
                str2 = str.substring(1,2).concat(str2);
                String str3 = str2.toLowerCase();

                if(str2.equals(str3)){
                    System.out.println("AC");
                }else{
                    System.out.println("WA"); 
                }

            }else{
                System.out.println("WA");    
            }
        }else{
            System.out.println("WA");
        }
    }
}