public static void main ( final String ... args ) throws IOException {
  final String fname = "B-large" ;
  final Scanner sc = new Scanner ( new File ( fname + ".in" ) ) ;
  final PrintWriter pw = new PrintWriter ( fname + ".out" ) ;
  final int t = sc . nextInt ( ) ;
  sc . nextLine ( ) ;
  for ( int i = 0 ;
  i < t ;
  ++ i ) {
    final char [ ] s = ( '0' + sc . nextLine ( ) ) . toCharArray ( ) ;
    final int [ ] d = new int [ 10 ] ;
    for ( char c : s ) {
      d [ c - '0' ] ++ ;
    }
    ++ s [ s . length - 1 ] ;
    final int [ ] d1 = new int [ 10 ] ;
    if ( ! run ( s , d1 , d , 0 ) ) {
      throw new RuntimeException ( ) ;
    }
    final String r = String . valueOf ( s ) ;
    pw . println ( "Case #" + ( i + 1 ) + ": " + ( s [ 0 ] == '0' ? r . substring ( 1 ) : r ) ) ;
  }
  pw . close ( ) ;
}

public static void main ( final String ... args ) throws IOException { final String fname = " B - large " ; final Scanner sc = new Scanner ( new File ( fname + " . in " ) ) ; final PrintWriter pw = new PrintWriter ( fname + " . out " ) ; final int t = sc . nextInt ( ) ; sc . nextLine ( ) ; for ( int i = 0 ; i < t ; ++ i ) { final char [ ] s = ( '0' + sc . nextLine ( ) ) . toCharArray ( ) ; final int [ ] d = new int [ 10 ] ; for ( char c : s ) { d [ c - '0' ] ++ ; } ++ s [ s . length - 1 ] ; final int [ ] d1 = new int [ 10 ] ; if ( ! run ( s , d1 , d , 0 ) ) { throw new RuntimeException ( ) ; } final String r = String . valueOf ( s ) ; pw . println ( " Case ▁ # " + ( i + 1 ) + " : ▁ " + ( s [ 0 ] == '0' ? r . substring ( 1 ) : r ) ) ; } pw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (spread_parameter (modifiers) (type_identifier) (variable_declarator name: (identifier)))) (throws (type_identifier)) body: (block (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator 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)))))))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (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 (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (parenthesized_expression (binary_expression left: (character_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) name: (identifier) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (identifier) right: (character_literal))))))) (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))))) (local_variable_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (decimal_integer_literal))))) consequence: (block (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list))))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (string_literal)) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (character_literal)) consequence: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) alternative: (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))