import java.util.*;
 
public class Main{
	static Scanner in = new Scanner(System.in);
		// int n = in.nextInt();
		// int[] a = new int[n];
		// for(int i = 0; i<n; i++){
		// 	a[i] = in.nextInt();
		// }

		// int min = Integer.MAX_VALUE;
  		// int max = Integer.MIN_VALUE;
 	
	public static void main(String[] args) {
		//zhan
		//dos
		//md
		int test = 1;
		while(test>0){
			solve();
			test--;
		}
	}

	public static void solve(){
		String str = in.next();
		for(char c: str.toCharArray()){
			if(c == 'A') continue;
			if(c == 'C') continue;

			if(Character.isUpperCase(c)){
				System.out.println("WA");
				return;
			}
		}
		if(str.charAt(0) != 'A'){
			System.out.println("WA");
		}else if(str.indexOf("C") == str.lastIndexOf("C") && (str.indexOf("C")>=2 && str.indexOf("C")<=str.length()-2)){
			System.out.println("AC");
		}else{
			System.out.println("WA");
		}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz