/*
substrの(int startindex, int lastindex)について
lastindexは「未満」なので、例えば末尾を指す時は
lastindex=s.length()で実質末尾をさせる
−１しなくてよい
*/

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  }

  public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  }

} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  }

  public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  }

} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int point = 0; point 0 int C_idx = 0; C_idx 0 if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    } s.charAt(0) == 'A' s.charAt(0) s.charAt s 0 'A' {
      point++;
    } point++ point {
      printAnswer(false);
    } printAnswer(false) printAnswer false if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    } s.indexOf('C') == s.lastIndexOf('C') s.indexOf('C') s.indexOf s 'C' s.lastIndexOf('C') s.lastIndexOf s 'C' {
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    } if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      } 2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 2 <= s.indexOf('C') 2 s.indexOf('C') s.indexOf s 'C' s.indexOf('C') <= s.length()-2 s.indexOf('C') s.indexOf s 'C' s.length()-2 s.length() s.length s 2 {
        point++;
        C_idx = s.indexOf('C');
      } point++ point C_idx = s.indexOf('C') C_idx s.indexOf('C') s.indexOf s 'C' {
        printAnswer(false);
      } printAnswer(false) printAnswer false {
      printAnswer(false);
    } printAnswer(false) printAnswer false String substr1 = s.substring(1, C_idx); substr1 s.substring(1, C_idx) s.substring s 1 C_idx String substr2 = s.substring(C_idx+1, s.length()); substr2 s.substring(C_idx+1, s.length()) s.substring s C_idx+1 C_idx 1 s.length() s.length s for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    } int i = 0; int i = 0; i 0 i < substr1.length() i substr1.length() substr1.length substr1 i++ i++ i {
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    } {
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    } if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      } !(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122) !(97 <= substr1.charAt(i)) (97 <= substr1.charAt(i)) 97 substr1.charAt(i) substr1.charAt substr1 i !(substr1.charAt(i) <= 122) (substr1.charAt(i) <= 122) substr1.charAt(i) substr1.charAt substr1 i 122 {
        printAnswer(false);
      } printAnswer(false) printAnswer false for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    } int i = 0; int i = 0; i 0 i < substr2.length() i substr2.length() substr2.length substr2 i++ i++ i {
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    } {
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    } if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      } !(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122) !(97 <= substr2.charAt(i)) (97 <= substr2.charAt(i)) 97 substr2.charAt(i) substr2.charAt substr2 i !(substr2.charAt(i) <= 122) (substr2.charAt(i) <= 122) substr2.charAt(i) substr2.charAt substr2 i 122 {
        printAnswer(false);
      } printAnswer(false) printAnswer false point++ point if(point == 3){printAnswer(true);} point == 3 point 3 {printAnswer(true);} printAnswer(true) printAnswer true String[] args args public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  } printAnswer {
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  } if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    } ans {
      System.out.println("AC");
    } System.out.println("AC") System.out.println System.out System System.out "AC" {
      System.out.println("WA");
      System.exit(0);
    } System.out.println("WA") System.out.println System.out System System.out "WA" System.exit(0) System.exit System 0 boolean ans ans public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  }

  public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  }

} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  }

  public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  }

} Main
/*
substrの(int startindex, int lastindex)について
lastindexは「未満」なので、例えば末尾を指す時は
lastindex=s.length()で実質末尾をさせる
−１しなくてよい
*/

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int point = 0;
    int C_idx = 0;

    if(s.charAt(0) == 'A'){
      point++;
    }else{
      printAnswer(false);
    }

    if(s.indexOf('C') == s.lastIndexOf('C')){
      if(2 <= s.indexOf('C') && s.indexOf('C') <= s.length()-2 ){
        point++;
        C_idx = s.indexOf('C');
      }else{
        printAnswer(false);
      }
    }else{
      printAnswer(false);
    }

    String substr1 = s.substring(1, C_idx);
    String substr2 = s.substring(C_idx+1, s.length());
    //System.out.println(substr1);
    //System.out.println(substr2);

    for(int i = 0; i < substr1.length(); i++){
      if(!(97 <= substr1.charAt(i)) || !(substr1.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    for(int i = 0; i < substr2.length(); i++){
      if(!(97 <= substr2.charAt(i)) || !(substr2.charAt(i) <= 122)){
        printAnswer(false);
      }
    }

    point++;

    if(point == 3){printAnswer(true);}
  }

  public static void printAnswer(boolean ans){
    if(ans){
      System.out.println("AC");
    }
    else{
      System.out.println("WA");
      System.exit(0);
    }
  }

}
