static void Directed_Graph ( int n , int m ) {
  for ( int i = 0 ;
  i < N ;
  i ++ ) colour [ i ] = - 1 ;
  bip = true ;
  dfs ( 1 , 1 ) ;
  if ( ! bip ) {
    System . out . print ( - 1 ) ;
    return ;
  }
  for ( int i = 0 ;
  i < m ;
  i ++ ) {
    if ( colour [ edges . get ( i ) . first ] == 0 ) {
      Collections . swap ( edges , edges . get ( i ) . first , edges . get ( i ) . second ) ;
    }
    System . out . println ( edges . get ( i ) . first + " " + edges . get ( i ) . second ) ;
  }
}

static void Directed_Graph ( int n , int m ) { for ( int i = 0 ; i < N ; i ++ ) colour [ i ] = - 1 ; bip = true ; dfs ( 1 , 1 ) ; if ( ! bip ) { System . out . print ( - 1 ) ; return ; } for ( int i = 0 ; i < m ; i ++ ) { if ( colour [ edges . get ( i ) . first ] == 0 ) { Collections . swap ( edges , edges . get ( i ) . first , edges . get ( i ) . second ) ; } System . out . println ( edges . get ( i ) . first + " ▁ " + edges . get ( i ) . second ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (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: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (unary_expression operand: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (true))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) field: (identifier))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) field: (identifier)) (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) field: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) field: (identifier)) right: (string_literal)) right: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) field: (identifier))))))))))