public static void main ( String [ ] args ) throws Exception {
  Scanner in = new Scanner ( new File ( "A-small-attempt0.in" ) ) ;
  PrintWriter out = new PrintWriter ( new FileWriter ( new File ( "A-small.out" ) ) ) ;
  int t = in . nextInt ( ) ;
  for ( int x = 0 ;
  x < t ;
  x ++ ) {
    int row1 = in . nextInt ( ) - 1 ;
    HashSet < Integer > cards = new HashSet < Integer > ( ) ;
    for ( int y = 0 ;
    y < 4 ;
    y ++ ) {
      for ( int z = 0 ;
      z < 4 ;
      z ++ ) {
        int card = in . nextInt ( ) ;
        if ( y == row1 ) {
          cards . add ( card ) ;
        }
      }
    }
    int row2 = in . nextInt ( ) - 1 ;
    int chosen = - 1 ;
    int count = 0 ;
    for ( int a = 0 ;
    a < 4 ;
    a ++ ) {
      for ( int b = 0 ;
      b < 4 ;
      b ++ ) {
        int card = in . nextInt ( ) ;
        if ( a == row2 && cards . contains ( card ) ) {
          chosen = card ;
          count ++ ;
        }
      }
    }
    out . print ( "Case #" + ( x + 1 ) + ": " ) ;
    if ( count == 1 ) {
      out . println ( chosen ) ;
    }
    else if ( count == 0 ) {
      out . println ( "Volunteer cheated!" ) ;
    }
    else {
      out . println ( "Bad magician!" ) ;
    }
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( new File ( " A - small - attempt0 . in " ) ) ; PrintWriter out = new PrintWriter ( new FileWriter ( new File ( " A - small . out " ) ) ) ; int t = in . nextInt ( ) ; for ( int x = 0 ; x < t ; x ++ ) { int row1 = in . nextInt ( ) - 1 ; HashSet < Integer > cards = new HashSet < Integer > ( ) ; for ( int y = 0 ; y < 4 ; y ++ ) { for ( int z = 0 ; z < 4 ; z ++ ) { int card = in . nextInt ( ) ; if ( y == row1 ) { cards . add ( card ) ; } } } int row2 = in . nextInt ( ) - 1 ; int chosen = - 1 ; int count = 0 ; for ( int a = 0 ; a < 4 ; a ++ ) { for ( int b = 0 ; b < 4 ; b ++ ) { int card = in . nextInt ( ) ; if ( a == row2 && cards . contains ( card ) ) { chosen = card ; count ++ ; } } } out . print ( " Case ▁ # " + ( x + 1 ) + " : ▁ " ) ; if ( count == 1 ) { out . println ( chosen ) ; } else if ( count == 0 ) { out . println ( " Volunteer ▁ cheated ! " ) ; } else { out . println ( " Bad ▁ magician ! " ) ; } } out . close ( ) ; }
(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 (local_variable_declaration 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 (string_literal))))))) (local_variable_declaration 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 (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (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: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (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: (identifier) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (update_expression (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))