public static void main ( String [ ] args ) {
  Scanner s = new Scanner ( System . in ) ;
  String ch ;
  do {
    ch = s . next ( ) ;
  }
  while ( ( ch . length ( ) < 1 ) && ( ch . length ( ) > 100 ) ) ;
  if ( ch . equals ( ch . toUpperCase ( ) ) ) {
    System . out . println ( ch . toLowerCase ( ) ) ;
  }
  else if ( Character . isLowerCase ( ch . charAt ( 0 ) ) && ( ch . substring ( 1 ) ) . equals ( ( ch . substring ( 1 ) ) . toUpperCase ( ) ) ) {
    System . out . println ( Character . toUpperCase ( ch . charAt ( 0 ) ) + ( ch . substring ( 1 ) ) . toLowerCase ( ) ) ;
  }
  else {
    System . out . println ( ch ) ;
  }
}

public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String ch ; do { ch = s . next ( ) ; } while ( ( ch . length ( ) < 1 ) && ( ch . length ( ) > 100 ) ) ; if ( ch . equals ( ch . toUpperCase ( ) ) ) { System . out . println ( ch . toLowerCase ( ) ) ; } else if ( Character . isLowerCase ( ch . charAt ( 0 ) ) && ( ch . substring ( 1 ) ) . equals ( ( ch . substring ( 1 ) ) . toUpperCase ( ) ) ) { System . out . println ( Character . toUpperCase ( ch . charAt ( 0 ) ) + ( ch . substring ( 1 ) ) . toLowerCase ( ) ) ; } else { System . out . println ( ch ) ; } }
(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))) (do_statement body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) right: (method_invocation object: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (method_invocation object: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) name: (identifier) arguments: (argument_list)))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) right: (method_invocation object: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) name: (identifier) arguments: (argument_list))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))))))))