import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc boolean j1 = false; j1 false if('A' == s.charAt(0)){
      j1 = true;
    } 'A' == s.charAt(0) 'A' s.charAt(0) s.charAt s 0 {
      j1 = true;
    } j1 = true j1 true boolean j2 = false; j2 false for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    } 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('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    } {
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    } if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      } 'C' == s.charAt(i) && j2 == false 'C' == s.charAt(i) 'C' s.charAt(i) s.charAt s i j2 == false j2 false {
        j2 = true;
      } j2 = true j2 true if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      } 'C' == s.charAt(i) && j2 == true 'C' == s.charAt(i) 'C' s.charAt(i) s.charAt s i j2 == true j2 true {
        j2 = false;
        break;
      } j2 = false j2 false break; boolean j3 = false; j3 false for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    } int i = 0 ; int i = 0 ; i 0 i < s.length() i s.length() s.length s ++i ++i i {
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    } {
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    } if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      } 'A' == s.charAt(i) 'A' s.charAt(i) s.charAt s i {
        j3 = true;
      } j3 = true j3 true if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      } 'C' == s.charAt(i) 'C' s.charAt(i) s.charAt s i {
        j3 = true;
      } j3 = true j3 true if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      } Character.isUpperCase(s.charAt(i))==false Character.isUpperCase(s.charAt(i)) Character.isUpperCase Character s.charAt(i) s.charAt s i false {
        j3 = true;
      } j3 = true j3 true {
        j3 = false;
        break;
      } j3 = false j3 false break; if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    } j1&&j2&&j3 j1&&j2&&j3 j1 j2 j3 {
      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" String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    //条件１
    boolean j1 = false;
    if('A' == s.charAt(0)){
      j1 = true;
    }
    
    //条件２
    boolean j2 = false;
    for(int i = 2 ; i < s.length()-1 ; ++i){
      if('C' == s.charAt(i) && j2 == false){
        j2 = true;
      }else if('C' == s.charAt(i) && j2 == true){
        j2 = false;
        break;
      }
    }

    //条件３
    boolean j3 = false;
    for(int i = 0 ; i < s.length() ; ++i){
      if('A' == s.charAt(i)){
        j3 = true;
      }else if('C' == s.charAt(i)){
        j3 = true;
      }else if(Character.isUpperCase(s.charAt(i))==false){
        j3 = true;
      }else{
        j3 = false;
        break;
      }
    }
    
    if(j1&&j2&&j3){
      System.out.println("AC");
    }else{
      System.out.println("WA");
    }
    
  }
}