import java.util.Scanner;

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

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    } in.hasNext() in.hasNext in {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    } String S = in.next(); S in.next() in.next in int oneCBetween = 0; oneCBetween 0 boolean otherLowerCase = true; otherLowerCase true for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      } int i = 2; int i = 2; i 2 i <= S.length() - 2 i S.length() - 2 S.length() S.length S 2 ++i ++i i {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      } {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      } if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        } S.charAt(i) == 'C' S.charAt(i) S.charAt S i 'C' {
          ++oneCBetween;
        } ++oneCBetween oneCBetween if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        } S.charAt(i) != 'A' S.charAt(i) S.charAt S i 'A' {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        } if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          } Character.isUpperCase(S.charAt(i)) Character.isUpperCase Character S.charAt(i) S.charAt S i {
            otherLowerCase = false;
          } otherLowerCase = false otherLowerCase false if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     } Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1)) Character.isUpperCase(S.charAt(1)) Character.isUpperCase Character S.charAt(1) S.charAt S 1 Character.isUpperCase(S.charAt(S.length() - 1)) Character.isUpperCase Character S.charAt(S.length() - 1) S.charAt S S.length() - 1 S.length() S.length S 1 {
       otherLowerCase = false;
     } otherLowerCase = false otherLowerCase false if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      } S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase S.charAt(0) == 'A' S.charAt(0) S.charAt S 0 'A' oneCBetween == 1 oneCBetween 1 otherLowerCase {
        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 in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  }
} Main
import java.util.Scanner;

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

    while (in.hasNext()) {
      String S = in.next();
      int oneCBetween = 0;
      boolean otherLowerCase = true;
      
      for (int i = 2; i <= S.length() - 2; ++i) {
        if (S.charAt(i) == 'C') {
          ++oneCBetween;
        } else if (S.charAt(i) != 'A') {
          if (Character.isUpperCase(S.charAt(i))) {
            otherLowerCase = false;
          }
        }
      }

     if (Character.isUpperCase(S.charAt(1)) || Character.isUpperCase(S.charAt(S.length() - 1))) {
       otherLowerCase = false;
     }

      if (S.charAt(0) == 'A' && oneCBetween == 1 && otherLowerCase) {
        System.out.println("AC");
      } else {
        System.out.println("WA");
      }
    }
  }
}