public static void main ( String [ ] args ) {
  Scanner s = new Scanner ( System . in ) ;
  String s1 = s . nextLine ( ) ;
  int n = s . nextInt ( ) ;
  char ch [ ] = {
    '^' , '>' , 'v' , '<' };
    int p1 = 0 , p2 = 0 ;
    for ( int i = 0 ;
    i < 4 ;
    i ++ ) {
      if ( ch [ i ] == s1 . charAt ( 0 ) ) p1 = i ;
      if ( ch [ i ] == s1 . charAt ( 2 ) ) p2 = i ;
    }
    int step = n % 4 ;
    if ( step != 0 && step != 2 ) {
      if ( ch [ ( p1 + step ) % 4 ] == ch [ p2 ] ) {
        System . out . println ( "cw" ) ;
      }
      else if ( ch [ Math . abs ( p2 + step ) % 4 ] == ch [ p1 ] ) System . out . println ( "ccw" ) ;
      else System . out . println ( "undefined" ) ;
    }
    else System . out . println ( "undefined" ) ;
  }
  
public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String s1 = s . nextLine ( ) ; int n = s . nextInt ( ) ; char ch [ ] = { ' ^ ' , ' > ' , ' v ' , ' < ' } ; int p1 = 0 , p2 = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { if ( ch [ i ] == s1 . charAt ( 0 ) ) p1 = i ; if ( ch [ i ] == s1 . charAt ( 2 ) ) p2 = i ; } int step = n % 4 ; if ( step != 0 && step != 2 ) { if ( ch [ ( p1 + step ) % 4 ] == ch [ p2 ] ) { System . out . println ( " cw " ) ; } else if ( ch [ Math . abs ( p2 + step ) % 4 ] == ch [ p1 ] ) System . out . println ( " ccw " ) ; else System . out . println ( " undefined " ) ; } else System . out . println ( " undefined " ) ; }
(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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_initializer (character_literal) (character_literal) (character_literal) (character_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))