public static void main ( String [ ] args ) {
  String fileName = "A-large.in" ;
  try ( BufferedReader br = new BufferedReader ( new FileReader ( fileName ) ) ) {
    try ( BufferedWriter bw = new BufferedWriter ( new FileWriter ( fileName + ".out" ) ) ) {
      int tests = Integer . valueOf ( br . readLine ( ) ) ;
      for ( int test = 1 ;
      test <= tests ;
      ++ test ) {
        int n = new Scanner ( br . readLine ( ) ) . nextInt ( ) ;
        Scanner scanner = new Scanner ( br . readLine ( ) ) ;
        int s [ ] = new int [ n ] ;
        for ( int i = 0 ;
        i < n ;
        ++ i ) s [ i ] = scanner . nextInt ( ) ;
        bw . write ( "Case #" + test + ": " ) ;
        while ( true ) {
          int max = 0 ;
          for ( int ss : s ) max = Math . max ( max , ss ) ;
          if ( max == 0 ) break ;
          ArrayList < Integer > pos = new ArrayList < Integer > ( ) ;
          for ( int i = 0 ;
          i < n ;
          ++ i ) {
            if ( s [ i ] == max ) pos . add ( i ) ;
          }
          int ps = pos . size ( ) ;
          if ( pos . size ( ) % 2 == 1 ) {
            ps -- ;
            int cur = pos . get ( pos . size ( ) - 1 ) ;
            s [ cur ] -- ;
            bw . write ( "" + ( char ) ( 'A' + cur ) + " " ) ;
          }
          for ( int i = 0 ;
          i < ps ;
          i += 2 ) {
            int c1 = pos . get ( i ) ;
            int c2 = pos . get ( i + 1 ) ;
            s [ c1 ] -- ;
            s [ c2 ] -- ;
            bw . write ( "" + ( char ) ( 'A' + c1 ) + ( char ) ( 'A' + c2 ) + " " ) ;
          }
        }
        bw . write ( "\n" ) ;
      }
      bw . close ( ) ;
    }
  }
  catch ( IOException e ) {
    e . printStackTrace ( ) ;
  }
}

public static void main ( String [ ] args ) { String fileName = " A - large . in " ; try ( BufferedReader br = new BufferedReader ( new FileReader ( fileName ) ) ) { try ( BufferedWriter bw = new BufferedWriter ( new FileWriter ( fileName + " . out " ) ) ) { int tests = Integer . valueOf ( br . readLine ( ) ) ; for ( int test = 1 ; test <= tests ; ++ test ) { int n = new Scanner ( br . readLine ( ) ) . nextInt ( ) ; Scanner scanner = new Scanner ( br . readLine ( ) ) ; int s [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) s [ i ] = scanner . nextInt ( ) ; bw . write ( " Case ▁ # " + test + " : ▁ " ) ; while ( true ) { int max = 0 ; for ( int ss : s ) max = Math . max ( max , ss ) ; if ( max == 0 ) break ; ArrayList < Integer > pos = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( s [ i ] == max ) pos . add ( i ) ; } int ps = pos . size ( ) ; if ( pos . size ( ) % 2 == 1 ) { ps -- ; int cur = pos . get ( pos . size ( ) - 1 ) ; s [ cur ] -- ; bw . write ( " " + ( char ) ( ' A ' + cur ) + " ▁ " ) ; } for ( int i = 0 ; i < ps ; i += 2 ) { int c1 = pos . get ( i ) ; int c2 = pos . get ( i + 1 ) ; s [ c1 ] -- ; s [ c2 ] -- ; bw . write ( " " + ( char ) ( ' A ' + c1 ) + ( char ) ( ' A ' + c2 ) + " ▁ " ) ; } } bw . write ( " \n " ) ; } bw . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } }
(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: (string_literal))) (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 (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (while_statement condition: (parenthesized_expression (true)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (assignment_expression left: (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: (break_statement)) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (character_literal) right: (identifier))))) right: (string_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: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (character_literal) right: (identifier))))) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (character_literal) right: (identifier))))) right: (string_literal))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (catch_clause (catch_formal_parameter (catch_type (type_identifier)) name: (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))))