public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  String str = sc . nextLine ( ) ;
  int size = str . length ( ) ;
  if ( "A" . equals ( str . substring ( 0 , 1 ) ) ) {
    int num = 0 ;
    String str2 = str . substring ( 2 , size - 1 ) ;
    int size2 = str2 . length ( ) ;
    for ( int i = 0 ;
    i < size2 ;
    i ++ ) {
      String str4 = str2 . substring ( 0 , 1 ) ;
      if ( str4 . equals ( "C" ) ) {
        num = num + 1 ;
      }
      str2 = str2 . substring ( 1 ) ;
    }
    if ( num == 1 ) {
      str2 = str . substring ( 2 , size - 1 ) ;
      str2 = str2 . replace ( "C" , "c" ) ;
      str2 = str2 . concat ( str . substring ( str . length ( ) - 1 ) ) ;
      str2 = str . substring ( 1 , 2 ) . concat ( str2 ) ;
      String str3 = str2 . toLowerCase ( ) ;
      if ( str2 . equals ( str3 ) ) {
        System . out . println ( "AC" ) ;
      }
      else {
        System . out . println ( "WA" ) ;
      }
    }
    else {
      System . out . println ( "WA" ) ;
    }
  }
  else {
    System . out . println ( "WA" ) ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; int size = str . length ( ) ; if ( " A " . equals ( str . substring ( 0 , 1 ) ) ) { int num = 0 ; String str2 = str . substring ( 2 , size - 1 ) ; int size2 = str2 . length ( ) ; for ( int i = 0 ; i < size2 ; i ++ ) { String str4 = str2 . substring ( 0 , 1 ) ; if ( str4 . equals ( " C " ) ) { num = num + 1 ; } str2 = str2 . substring ( 1 ) ; } if ( num == 1 ) { str2 = str . substring ( 2 , size - 1 ) ; str2 = str2 . replace ( " C " , " c " ) ; str2 = str2 . concat ( str . substring ( str . length ( ) - 1 ) ) ; str2 = str . substring ( 1 , 2 ) . concat ( str2 ) ; String str3 = str2 . toLowerCase ( ) ; if ( str2 . equals ( str3 ) ) { System . out . println ( " AC " ) ; } else { System . out . println ( " WA " ) ; } } else { System . out . println ( " WA " ) ; } } else { System . out . println ( " WA " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (string_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal))) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))