import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	} Scanner sc1 = new Scanner(System.in); sc1 new Scanner(System.in) String str1 = sc1.next(); str1 sc1.next() sc1.next sc1 StringBuilder sb1 = new StringBuilder(); sb1 new StringBuilder() StringBuilder sb2 = new StringBuilder(); sb2 new StringBuilder() sb1.append(str1) sb1.append sb1 str1 sb2.append(str1.toLowerCase()) sb2.append sb2 str1.toLowerCase() str1.toLowerCase str1 String str2 = sb2.toString(); str2 sb2.toString() sb2.toString sb2 boolean flg = true; flg true if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		} str1.charAt(0) != 'A' str1.charAt(0) str1.charAt str1 0 'A' {
			flg = false;
			//System.out.println("test1");
		} flg = false flg false sb1.deleteCharAt(0) sb1.deleteCharAt sb1 0 sb1.insert(0,"a") sb1.insert sb1 0 "a" int tmp = str1.indexOf('C'); tmp str1.indexOf('C') str1.indexOf str1 'C' if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		} tmp < 2 | tmp > str1.length()-2 tmp < 2 tmp 2 tmp > str1.length()-2 tmp str1.length()-2 str1.length() str1.length str1 2 {
			flg = false;
			//System.out.println("test2");
		} flg = false flg false {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		} sb1.deleteCharAt(tmp) sb1.deleteCharAt sb1 tmp sb1.insert(tmp,"c") sb1.insert sb1 tmp "c" tmp = str1.indexOf('C', tmp + 1) tmp str1.indexOf('C', tmp + 1) str1.indexOf str1 'C' tmp + 1 tmp 1 if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			} tmp > 0 tmp 0 {
				flg = false;
				//System.out.println("test3");
			} flg = false flg false str1 = sb1.toString() str1 sb1.toString() sb1.toString sb1 if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		} !(str1.equals(str2)) (str1.equals(str2)) str1.equals str1 str2 {
			flg = false;
			//System.out.println("test4");
		} flg = false flg false if (flg) {
			System.out.println("AC");
		}
		else {
			System.out.println("WA");
		} flg {
			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" sc1.close() sc1.close sc1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		String str1 = sc1.next();
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb1.append(str1);
		sb2.append(str1.toLowerCase());
		String str2 = sb2.toString();

		boolean flg = true;

		if ( str1.charAt(0) != 'A') {
			flg = false;
			//System.out.println("test1");
		}
		sb1.deleteCharAt(0);
		sb1.insert(0,"a");

		int tmp = str1.indexOf('C');

		if ( tmp < 2 | tmp > str1.length()-2) {
			flg = false;
			//System.out.println("test2");
		}
		else {
			sb1.deleteCharAt(tmp);
			sb1.insert(tmp,"c");
			tmp = str1.indexOf('C', tmp + 1);
			if ( tmp > 0) {
				flg = false;
				//System.out.println("test3");
			}
		}

		str1 = sb1.toString();

		if ( !(str1.equals(str2)) ) {
			flg = false;
			//System.out.println("test4");
		}

		//System.out.println(sb1);
		//System.out.println(sb2);

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

		sc1.close();
	}

}