public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  String str = sc . nextLine ( ) ;
  int L = str . length ( ) ;
  int cnt = 0 ;
  boolean check = true ;
  for ( int i = 0 ;
  i < L ;
  i ++ ) {
    if ( i == 0 ) {
      if ( str . charAt ( i ) != 'A' ) {
        check = false ;
      }
    }
    else if ( 2 <= i && i <= L - 2 ) {
      if ( str . charAt ( i ) == 'C' ) {
        cnt ++ ;
      }
      else if ( 'A' <= str . charAt ( i ) && str . charAt ( i ) <= 'Z' ) {
        check = false ;
      }
    }
    else {
      if ( 'A' <= str . charAt ( i ) && str . charAt ( i ) <= 'Z' ) check = false ;
    }
  }
  if ( cnt != 1 ) {
    check = false ;
  }
  if ( check ) {
    System . out . println ( "AC" ) ;
  }
  else {
    System . out . println ( "WA" ) ;
  }
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; int L = str . length ( ) ; int cnt = 0 ; boolean check = true ; for ( int i = 0 ; i < L ; i ++ ) { if ( i == 0 ) { if ( str . charAt ( i ) != ' A ' ) { check = false ; } } else if ( 2 <= i && i <= L - 2 ) { if ( str . charAt ( i ) == ' C ' ) { cnt ++ ; } else if ( ' A ' <= str . charAt ( i ) && str . charAt ( i ) <= ' Z ' ) { check = false ; } } else { if ( ' A ' <= str . charAt ( i ) && str . charAt ( i ) <= ' Z ' ) check = false ; } } if ( cnt != 1 ) { check = false ; } if ( check ) { System . out . println ( " AC " ) ; } else { System . out . println ( " WA " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) 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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (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 (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (update_expression (identifier)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (character_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (character_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))))) (if_statement condition: (parenthesized_expression (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))))))))