public static String VertexColoring ( int N ) {
  Queue < pair > q = new LinkedList < > ( ) ;
  q . offer ( new pair ( 0 , 0 ) ) ;
  q . offer ( new pair ( N - 1 , 1 ) ) ;
  int color [ ] = new int [ N ] ;
  Arrays . fill ( color , - 1 ) ;
  while ( ! q . isEmpty ( ) ) {
    pair p = q . poll ( ) ;
    if ( color [ p . i ] == - 1 ) {
      color [ p . i ] = p . j ;
      Iterator < Integer > itr = adj [ p . i ] . iterator ( ) ;
      while ( itr . hasNext ( ) ) {
        q . offer ( new pair ( itr . next ( ) , p . j ) ) ;
      }
    }
  }
  int s [ ] = new int [ 2 ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    s [ color [ i ] ] ++ ;
  }
  return s [ 0 ] > s [ 1 ] ? "Fennec" : "Snuke" ;
}

public static String VertexColoring ( int N ) { Queue < pair > q = new LinkedList < > ( ) ; q . offer ( new pair ( 0 , 0 ) ) ; q . offer ( new pair ( N - 1 , 1 ) ) ; int color [ ] = new int [ N ] ; Arrays . fill ( color , - 1 ) ; while ( ! q . isEmpty ( ) ) { pair p = q . poll ( ) ; if ( color [ p . i ] == - 1 ) { color [ p . i ] = p . j ; Iterator < Integer > itr = adj [ p . i ] . iterator ( ) ; while ( itr . hasNext ( ) ) { q . offer ( new pair ( itr . next ( ) , p . j ) ) ; } } } int s [ ] = new int [ 2 ] ; for ( int i = 0 ; i < N ; i ++ ) { s [ color [ i ] ] ++ ; } return s [ 0 ] > s [ 1 ] ? " Fennec " : " Snuke " ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (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)) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (unary_expression operand: (decimal_integer_literal))))) (while_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier))) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier))) right: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (array_access array: (identifier) index: (field_access object: (identifier) field: (identifier))) name: (identifier) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (field_access object: (identifier) field: (identifier))))))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) 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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))))))) (return_statement (ternary_expression condition: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) consequence: (string_literal) alternative: (string_literal)))))