public static void main ( String [ ] args ) {
  try {
    Scanner sc = new Scanner ( new File ( "A-large.in" ) ) ;
    BufferedWriter bw = new BufferedWriter ( new FileWriter ( new File ( "output.out" ) ) ) ;
    int t = sc . nextInt ( ) ;
    X : for ( int i = 0 ;
    i < t ;
    i ++ ) {
      bw . write ( "Case #" + String . valueOf ( i + 1 ) + ": " ) ;
      int r = 0 ;
      int n = sc . nextInt ( ) ;
      d = new int [ n ] ;
      p = new int [ n ] [ n ] ;
      for ( int j = 0 ;
      j < n ;
      j ++ ) {
        d [ j ] = sc . nextInt ( ) ;
        for ( int k = 0 ;
        k < d [ j ] ;
        k ++ ) p [ j ] [ k ] = sc . nextInt ( ) - 1 ;
      }
      for ( int j = 0 ;
      j < n ;
      j ++ ) {
        g = new boolean [ n ] ;
        if ( traverse ( j ) ) {
          bw . write ( "Yes" ) ;
          bw . newLine ( ) ;
          bw . flush ( ) ;
          continue X ;
        }
      }
      bw . write ( "No" ) ;
      bw . newLine ( ) ;
      bw . flush ( ) ;
    }
    bw . close ( ) ;
  }
  catch ( Exception ex ) {
    Logger . getLogger ( QA . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ;
  }
}

public static void main ( String [ ] args ) { try { Scanner sc = new Scanner ( new File ( " A - large . in " ) ) ; BufferedWriter bw = new BufferedWriter ( new FileWriter ( new File ( " output . out " ) ) ) ; int t = sc . nextInt ( ) ; X : for ( int i = 0 ; i < t ; i ++ ) { bw . write ( " Case ▁ # " + String . valueOf ( i + 1 ) + " : ▁ " ) ; int r = 0 ; int n = sc . nextInt ( ) ; d = new int [ n ] ; p = new int [ n ] [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { d [ j ] = sc . nextInt ( ) ; for ( int k = 0 ; k < d [ j ] ; k ++ ) p [ j ] [ k ] = sc . nextInt ( ) - 1 ; } for ( int j = 0 ; j < n ; j ++ ) { g = new boolean [ n ] ; if ( traverse ( j ) ) { bw . write ( " Yes " ) ; bw . newLine ( ) ; bw . flush ( ) ; continue X ; } } bw . write ( " No " ) ; bw . newLine ( ) ; bw . flush ( ) ; } bw . close ( ) ; } catch ( Exception ex ) { Logger . getLogger ( QA . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } }
(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 (try_statement 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)))) (labeled_statement (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: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))) right: (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) 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: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (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: (array_access array: (identifier) index: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (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))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (continue_statement (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (null_literal) (identifier)))))))))