public static int [ ] solve ( int N , int x ) {
  int [ ] ans = new int [ 2 * N - 1 ] ;
  if ( N == 2 ) {
    return new int [ ] {
      1 , 2 , 3 };
    }
    if ( x == 2 ) {
      ans [ N - 2 ] = 2 * N - 1 ;
      ans [ N - 1 ] = 2 ;
      ans [ N ] = 1 ;
      ans [ N + 1 ] = 2 * N - 2 ;
      int elm = 3 ;
      for ( int index = 0 ;
      index < 2 * N - 1 ;
      index ++ ) {
        if ( ans [ index ] == 0 ) {
          ans [ index ] = elm ;
          elm ++ ;
        }
      }
    }
    else {
      ans [ N - 2 ] = 1 ;
      ans [ N - 1 ] = x ;
      ans [ N ] = 2 * N - 1 ;
      ans [ N + 1 ] = 2 ;
      int elm = 3 ;
      for ( int index = 0 ;
      index < 2 * N - 1 ;
      index ++ ) {
        if ( elm == x ) elm ++ ;
        if ( ans [ index ] == 0 ) {
          ans [ index ] = elm ;
          elm ++ ;
        }
      }
    }
    return ans ;
  }
  
public static int [ ] solve ( int N , int x ) { int [ ] ans = new int [ 2 * N - 1 ] ; if ( N == 2 ) { return new int [ ] { 1 , 2 , 3 } ; } if ( x == 2 ) { ans [ N - 2 ] = 2 * N - 1 ; ans [ N - 1 ] = 2 ; ans [ N ] = 1 ; ans [ N + 1 ] = 2 * N - 2 ; int elm = 3 ; for ( int index = 0 ; index < 2 * N - 1 ; index ++ ) { if ( ans [ index ] == 0 ) { ans [ index ] = elm ; elm ++ ; } } } else { ans [ N - 2 ] = 1 ; ans [ N - 1 ] = x ; ans [ N ] = 2 * N - 1 ; ans [ N + 1 ] = 2 ; int elm = 3 ; for ( int index = 0 ; index < 2 * N - 1 ; index ++ ) { if ( elm == x ) elm ++ ; if ( ans [ index ] == 0 ) { ans [ index ] = elm ; elm ++ ; } } } return ans ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (return_statement (array_creation_expression type: (integral_type) dimensions: (dimensions) value: (array_initializer (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (expression_statement (update_expression (identifier)))))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (expression_statement (update_expression (identifier))))))))) (return_statement (identifier))))