static int smallestNumber ( int n ) {
  int num = 0 ;
  String s = "" ;
  int duplicate = n ;
  while ( n > 0 ) {
    s = ( char ) ( n % 10 + 48 ) + s ;
    n /= 10 ;
  }
  int index = - 1 ;
  for ( int i = 0 ;
  i < s . length ( ) ;
  i ++ ) {
    int digit = s . charAt ( i ) - '0' ;
    if ( ( digit & 1 ) == 0 ) {
      index = i ;
      break ;
    }
  }
  if ( index == - 1 ) {
    return duplicate ;
  }
  for ( int i = 0 ;
  i < index ;
  i ++ ) {
    num = num * 10 + ( s . charAt ( i ) - '0' ) ;
  }
  num = num * 10 + ( s . charAt ( index ) - '0' + 1 ) ;
  for ( int i = index + 1 ;
  i < s . length ( ) ;
  i ++ ) {
    num = num * 10 + 1 ;
  }
  return num ;
}

static int smallestNumber ( int n ) { int num = 0 ; String s = " " ; int duplicate = n ; while ( n > 0 ) { s = ( char ) ( n % 10 + 48 ) + s ; n /= 10 ; } int index = - 1 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int digit = s . charAt ( i ) - '0' ; if ( ( digit & 1 ) == 0 ) { index = i ; break ; } } if ( index == - 1 ) { return duplicate ; } for ( int i = 0 ; i < index ; i ++ ) { num = num * 10 + ( s . charAt ( i ) - '0' ) ; } num = num * 10 + ( s . charAt ( index ) - '0' + 1 ) ; for ( int i = index + 1 ; i < s . length ( ) ; i ++ ) { num = num * 10 + 1 ; } return num ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (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: (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (return_statement (identifier)))) (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 (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))))) (return_statement (identifier))))