import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	}
	
	public static void print(String string) {
		System.out.println(string);
	}
	
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	
	public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	}
	
	public static void print(String string) {
		System.out.println(string);
	}
	
} Main public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	} main {
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	} InputStreamReader inputStreamReader = new InputStreamReader(System.in); inputStreamReader new InputStreamReader(System.in) BufferedReader bufferedReader = new BufferedReader(inputStreamReader); bufferedReader new BufferedReader(inputStreamReader) String input = bufferedReader.readLine(); input bufferedReader.readLine() bufferedReader.readLine bufferedReader char[] inputArray = input.toCharArray(); inputArray input.toCharArray() input.toCharArray input int lengthOfInput = input.length(); lengthOfInput input.length() input.length input char first = inputArray[0]; first inputArray[0] inputArray 0 boolean condition1 = (first == 'A'); condition1 (first == 'A') first 'A' int numberOfC = 0; numberOfC 0 int cAt = 0; cAt 0 boolean condition2 = false; condition2 false for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		} int a = 2; int a = 2; a 2 a <= lengthOfInput - 2 a lengthOfInput - 2 lengthOfInput 2 a++ a++ a {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		} {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		} if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			} inputArray[a] == 'C' inputArray[a] inputArray a 'C' {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			} if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				} numberOfC == 0 numberOfC 0 {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				} condition2 = true condition2 true cAt = a cAt a numberOfC++ numberOfC {
					condition2 = false;
					break;
				} condition2 = false condition2 false break; boolean condition3 = false; condition3 false for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		} int a = 0; int a = 0; a 0 a < lengthOfInput a lengthOfInput a++ a++ a {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		} {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		} if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			} a != 0 && a != cAt a != 0 a 0 a != cAt a cAt {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			} condition3 = Character.isLowerCase(inputArray[a]) condition3 Character.isLowerCase(inputArray[a]) Character.isLowerCase Character inputArray[a] inputArray a if(!condition3) {
					break;
				} !condition3 condition3 {
					break;
				} break; if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		} condition1 && condition2 && condition3 condition1 && condition2 && condition3 condition1 condition2 condition3 {
			print("AC");
		} print("AC") print "AC" {
			print("WA");
		} print("WA") print "WA" String[] agrs agrs public static void print(String string) {
		System.out.println(string);
	} print {
		System.out.println(string);
	} System.out.println(string) System.out.println System.out System System.out string String string string public class Main {
	
	public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	}
	
	public static void print(String string) {
		System.out.println(string);
	}
	
} public class Main {
	
	public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	}
	
	public static void print(String string) {
		System.out.println(string);
	}
	
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] agrs) throws IOException{
		
		InputStreamReader inputStreamReader = new InputStreamReader(System.in);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
		
		String input = bufferedReader.readLine();
		char[] inputArray = input.toCharArray();
		int lengthOfInput = input.length();
				
		char first = inputArray[0];
		boolean condition1 = (first == 'A');
		
		int numberOfC = 0;
		int cAt = 0;
		boolean condition2 = false;
		
		for (int a = 2; a <= lengthOfInput - 2; a++) {
			if(inputArray[a] == 'C') {
				
				if(numberOfC == 0) {
					condition2 = true;
					cAt = a;
					
					numberOfC++;
				}else {
					condition2 = false;
					break;
				}
			}
		}
		
		boolean condition3 = false;
		
		for(int a = 0; a < lengthOfInput; a++) {
			if(a != 0 && a != cAt) {
				condition3 = Character.isLowerCase(inputArray[a]);
				if(!condition3) {
					break;
				}
			}
		}
		
		if(condition1 && condition2 && condition3) {
			print("AC");
		}else {
			print("WA");
		}
	}
	
	public static void print(String string) {
		System.out.println(string);
	}
	
}
