import java.util.*;

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

        String ans;

        if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        String ans;

        if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        }

        System.out.println(ans);
    }
} Main public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        String ans;

        if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        String ans;

        if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String ans; ans if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        } s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z' s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z' s.charAt(0) != 'A' s.charAt(0) s.charAt s 0 'A' s.charAt(1) <= 'Z' s.charAt(1) s.charAt s 1 'Z' s.charAt(s.length() - 1) <= 'Z' s.charAt(s.length() - 1) s.charAt s s.length() - 1 s.length() s.length s 1 'Z' ans = "WA" ans "WA" {
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        } int c_count = 0; c_count 0 int small_count = 0; small_count 0 int other = 0; other 0 for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            } int i = 2; int i = 2; i 2 i < s.length() - 1 i s.length() - 1 s.length() s.length s 1 i++ i++ i {
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            } {
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            } if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++; s.charAt(i) == 'C' s.charAt(i) s.charAt s i 'C' c_count++ c_count if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++; s.charAt(i) <= 'z' && s.charAt(i) >= 'a' s.charAt(i) <= 'z' s.charAt(i) s.charAt s i 'z' s.charAt(i) >= 'a' s.charAt(i) s.charAt s i 'a' small_count++ small_count other++ other if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA"; c_count == 1 && small_count == s.length() - 4 && other == 0 c_count == 1 && small_count == s.length() - 4 && other == 0 c_count == 1 c_count 1 small_count == s.length() - 4 small_count s.length() - 4 s.length() s.length s 4 other == 0 other 0 ans = "AC" ans "AC" ans = "WA" ans "WA" System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

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

        String ans;

        if(s.charAt(0) != 'A' || s.charAt(1) <= 'Z' || s.charAt(s.length() - 1) <= 'Z') ans = "WA";

        else{
            int c_count = 0;
            int small_count = 0;
            int other = 0;
            for(int i = 2; i < s.length() - 1; i++){
                if(s.charAt(i) == 'C')     c_count++;
                else if(s.charAt(i) <= 'z' && s.charAt(i) >= 'a') small_count++;
                else other++;
            }

            if(c_count == 1 && small_count == s.length() - 4 && other == 0) ans = "AC";
            else ans = "WA";
        }

        System.out.println(ans);
    }
}