public static void main ( String [ ] args ) throws Exception {
  System . setIn ( new FileInputStream ( "A-small-attempt0.in" ) ) ;
  System . setOut ( new PrintStream ( new FileOutputStream ( "A-small-attempt0.out" ) ) ) ;
  Scanner in = new Scanner ( System . in ) ;
  int T = in . nextInt ( ) ;
  for ( int caseNum = 1 ;
  caseNum <= T ;
  caseNum ++ ) {
    int [ ] counts = new int [ 17 ] ;
    for ( int turn = 0 ;
    turn < 2 ;
    turn ++ ) {
      int row = in . nextInt ( ) - 1 ;
      for ( int r = 0 ;
      r < 4 ;
      r ++ ) {
        for ( int c = 0 ;
        c < 4 ;
        c ++ ) {
          int n = in . nextInt ( ) ;
          if ( r == row ) {
            counts [ n ] ++ ;
          }
        }
      }
    }
    int res = - 2 ;
    for ( int i = 1 ;
    i <= 16 ;
    i ++ ) {
      if ( counts [ i ] == 2 ) {
        if ( res == - 2 ) {
          res = i ;
        }
        else {
          res = - 1 ;
        }
      }
    }
    if ( res > 0 ) {
      System . out . printf ( "Case #%d: %d%n" , caseNum , res ) ;
    }
    else {
      System . out . printf ( "Case #%d: %s%n" , caseNum , ( res == - 2 ) ? "Volunteer cheated!" : "Bad magician!" ) ;
    }
  }
}

public static void main ( String [ ] args ) throws Exception { System . setIn ( new FileInputStream ( " A - small - attempt0 . in " ) ) ; System . setOut ( new PrintStream ( new FileOutputStream ( " A - small - attempt0 . out " ) ) ) ; Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int caseNum = 1 ; caseNum <= T ; caseNum ++ ) { int [ ] counts = new int [ 17 ] ; for ( int turn = 0 ; turn < 2 ; turn ++ ) { int row = in . nextInt ( ) - 1 ; for ( int r = 0 ; r < 4 ; r ++ ) { for ( int c = 0 ; c < 4 ; c ++ ) { int n = in . nextInt ( ) ; if ( r == row ) { counts [ n ] ++ ; } } } } int res = - 2 ; for ( int i = 1 ; i <= 16 ; i ++ ) { if ( counts [ i ] == 2 ) { if ( res == - 2 ) { res = i ; } else { res = - 1 ; } } } if ( res > 0 ) { System . out . printf ( " Case ▁ # % d : ▁ % d % n " , caseNum , res ) ; } else { System . out . printf ( " Case ▁ # % d : ▁ % s % n " , caseNum , ( res == - 2 ) ? " Volunteer ▁ cheated ! " : " Bad ▁ magician ! " ) ; } } }
(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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal)))))) (expression_statement (method_invocation object: (identifier) name: (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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (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: (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))))) (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: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (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: (identifier) right: (identifier))) consequence: (block (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))))))))))) (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal) (identifier) (identifier))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal) (identifier) (ternary_expression condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (string_literal) alternative: (string_literal)))))))))))