public static void dfs ( int max , int n1 , int n2 , long t , Set < Long > set ) {
  if ( t > max ) {
    return ;
  }
  if ( t > 0 ) {
    set . add ( t ) ;
  }
  if ( t != 0 || n1 != 0 ) {
    dfs ( max , n1 , n2 , t * 10 + n1 , set ) ;
  }
  if ( t != 0 || n2 != 0 ) {
    dfs ( max , n2 , n1 , t * 10 + n2 , set ) ;
  }
}

public static void dfs ( int max , int n1 , int n2 , long t , Set < Long > set ) { if ( t > max ) { return ; } if ( t > 0 ) { set . add ( t ) ; } if ( t != 0 || n1 != 0 ) { dfs ( max , n1 , n2 , t * 10 + n1 , set ) ; } if ( t != 0 || n2 != 0 ) { dfs ( max , n2 , n1 , t * 10 + n2 , set ) ; } }
(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)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) (identifier))))))))