public static void main ( String [ ] args ) {
  FastScanner input = new FastScanner ( ) ;
  int x = input . nextInt ( ) ;
  int k = input . nextInt ( ) ;
  boolean xx [ ] = new boolean [ x + 1 ] ;
  for ( int i = 0 ;
  i < k ;
  i ++ ) {
    int type = input . nextInt ( ) ;
    if ( type == 1 ) {
      int div2 = input . nextInt ( ) ;
      int div1 = input . nextInt ( ) ;
      xx [ div1 ] = xx [ div2 ] = true ;
    }
    else {
      int div2 = input . nextInt ( ) ;
      xx [ div2 ] = true ;
    }
  }
  xx [ x ] = true ;
  ;
}

public static void main ( String [ ] args ) { FastScanner input = new FastScanner ( ) ; int x = input . nextInt ( ) ; int k = input . nextInt ( ) ; boolean xx [ ] = new boolean [ x + 1 ] ; for ( int i = 0 ; i < k ; i ++ ) { int type = input . nextInt ( ) ; if ( type == 1 ) { int div2 = input . nextInt ( ) ; int div1 = input . nextInt ( ) ; xx [ div1 ] = xx [ div2 ] = true ; } else { int div2 = input . nextInt ( ) ; xx [ div2 ] = true ; } } xx [ x ] = true ; ; }
(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: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (binary_expression left: (identifier) 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 (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: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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: (array_access array: (identifier) index: (identifier)) right: (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))))) alternative: (block (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: (array_access array: (identifier) index: (identifier)) right: (true))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true)))))