public static void main ( String [ ] args ) {
  Scanner scanner = new Scanner ( System . in ) ;
  int n = scanner . nextInt ( ) ;
  char [ ] s = scanner . next ( ) . toCharArray ( ) ;
  char [ ] t = scanner . next ( ) . toCharArray ( ) ;
  HashMap < Character , Integer > d = new HashMap < > ( ) ;
  int changes = 0 ;
  HashMap < String , Integer > dict = new HashMap < > ( ) ;
  int res = 0 , r1 = - 1 , r2 = - 1 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    char x = s [ i ] , y = t [ i ] ;
    if ( x != y ) {
      changes ++ ;
      d . putIfAbsent ( x , i ) ;
      if ( res == 2 ) continue ;
      String s1 = String . valueOf ( y ) + String . valueOf ( x ) ;
      if ( dict . get ( s1 ) != null ) {
        res = 2 ;
        r1 = dict . get ( s1 ) + 1 ;
        r2 = i + 1 ;
      }
      dict . putIfAbsent ( String . valueOf ( x ) + String . valueOf ( y ) , i ) ;
    }
  }
  if ( res == 2 ) {
    System . out . println ( changes - res ) ;
    System . out . println ( r1 + " " + r2 ) ;
    System . exit ( 0 ) ;
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    char x = s [ i ] , y = t [ i ] ;
    if ( x != y ) {
      if ( d . get ( y ) != null ) {
        res = 1 ;
        r1 = i + 1 ;
        r2 = d . get ( y ) + 1 ;
        break ;
      }
    }
  }
  System . out . println ( changes - res ) ;
  System . out . println ( r1 + " " + r2 ) ;
}

public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; char [ ] s = scanner . next ( ) . toCharArray ( ) ; char [ ] t = scanner . next ( ) . toCharArray ( ) ; HashMap < Character , Integer > d = new HashMap < > ( ) ; int changes = 0 ; HashMap < String , Integer > dict = new HashMap < > ( ) ; int res = 0 , r1 = - 1 , r2 = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { char x = s [ i ] , y = t [ i ] ; if ( x != y ) { changes ++ ; d . putIfAbsent ( x , i ) ; if ( res == 2 ) continue ; String s1 = String . valueOf ( y ) + String . valueOf ( x ) ; if ( dict . get ( s1 ) != null ) { res = 2 ; r1 = dict . get ( s1 ) + 1 ; r2 = i + 1 ; } dict . putIfAbsent ( String . valueOf ( x ) + String . valueOf ( y ) , i ) ; } } if ( res == 2 ) { System . out . println ( changes - res ) ; System . out . println ( r1 + " ▁ " + r2 ) ; System . exit ( 0 ) ; } for ( int i = 0 ; i < n ; i ++ ) { char x = s [ i ] , y = t [ i ] ; if ( x != y ) { if ( d . get ( y ) != null ) { res = 1 ; r1 = i + 1 ; r2 = d . get ( y ) + 1 ; break ; } } } System . out . println ( changes - res ) ; System . out . println ( r1 + " ▁ " + r2 ) ; }
(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: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier))) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (continue_statement)) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (null_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier))) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (null_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (decimal_integer_literal)))) (break_statement))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))))