public static void main ( String [ ] args ) throws Throwable {
  try ( BufferedReader in = new BufferedReader ( new FileReader ( FILENAME + ".in" ) ) ) {
    try ( PrintStream out = ! STANDARD_OUTPUT ? new PrintStream ( FILENAME + ".out" ) : System . out ) {
      for ( int t = 1 , T = Integer . parseInt ( in . readLine ( ) ) ;
      t <= T ;
      t ++ ) {
        char [ ] N = in . readLine ( ) . toCharArray ( ) ;
        int i = 1 , k = 0 ;
        for ( i = 1 ;
        i < N . length && N [ i ] >= N [ i - 1 ] ;
        i ++ ) {
        }
        if ( i < N . length ) {
          for ( k = i - 1 ;
          k >= 0 && N [ k ] == N [ i - 1 ] ;
          k -- ) {
          }
          N [ ++ k ] -- ;
          Arrays . fill ( N , k + 1 , N . length , '9' ) ;
          k = k == 0 && N [ 0 ] == '0' ? 1 : 0 ;
        }
        out . println ( "Case #" + t + ": " + new String ( N , k , N . length - k ) ) ;
      }
    }
  }
}

public static void main ( String [ ] args ) throws Throwable { try ( BufferedReader in = new BufferedReader ( new FileReader ( FILENAME + " . in " ) ) ) { try ( PrintStream out = ! STANDARD_OUTPUT ? new PrintStream ( FILENAME + " . out " ) : System . out ) { for ( int t = 1 , T = Integer . parseInt ( in . readLine ( ) ) ; t <= T ; t ++ ) { char [ ] N = in . readLine ( ) . toCharArray ( ) ; int i = 1 , k = 0 ; for ( i = 1 ; i < N . length && N [ i ] >= N [ i - 1 ] ; i ++ ) { } if ( i < N . length ) { for ( k = i - 1 ; k >= 0 && N [ k ] == N [ i - 1 ] ; k -- ) { } N [ ++ k ] -- ; Arrays . fill ( N , k + 1 , N . length , '9' ) ; k = k == 0 && N [ 0 ] == '0' ? 1 : 0 ; } out . println ( " Case ▁ # " + t + " : ▁ " + new String ( N , k , N . length - k ) ) ; } } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (try_with_resources_statement resources: (resource_specification (resource type: (type_identifier) name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))))) body: (block (try_with_resources_statement resources: (resource_specification (resource type: (type_identifier) name: (identifier) value: (ternary_expression condition: (unary_expression operand: (identifier)) consequence: (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))) alternative: (field_access object: (identifier) field: (identifier))))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) update: (update_expression (identifier)) body: (block)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (for_statement init: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) update: (update_expression (identifier)) body: (block)) (expression_statement (update_expression (array_access array: (identifier) index: (update_expression (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (field_access object: (identifier) field: (identifier)) (character_literal)))) (expression_statement (assignment_expression left: (identifier) right: (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (character_literal))) consequence: (decimal_integer_literal) alternative: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))))))))))))))))