public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  int largest ;
  int smallest ;
  int help ;
  int z1 = 0 ;
  int arr1 [ ] = new int [ n ] ;
  for ( int i1 = 0 ;
  i1 < n ;
  i1 ++ ) {
    arr1 [ i1 ] = sc . nextInt ( ) ;
  }
  for ( int i2 = 0 ;
  i2 < n ;
  i2 ++ ) {
    for ( int i3 = i2 ;
    i3 < n ;
    i3 ++ ) {
      int o1 = ( arr1 [ i2 ] > arr1 [ i3 ] ) ? ( arr1 [ i2 ] ) : ( arr1 [ i3 ] ) ;
      arr1 [ i3 ] = ( arr1 [ i2 ] < arr1 [ i3 ] ) ? ( arr1 [ i2 ] ) : ( arr1 [ i3 ] ) ;
      arr1 [ i2 ] = o1 ;
    }
  }
  largest = arr1 [ 0 ] ;
  smallest = arr1 [ n - 1 ] ;
  ;
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int largest ; int smallest ; int help ; int z1 = 0 ; int arr1 [ ] = new int [ n ] ; for ( int i1 = 0 ; i1 < n ; i1 ++ ) { arr1 [ i1 ] = sc . nextInt ( ) ; } for ( int i2 = 0 ; i2 < n ; i2 ++ ) { for ( int i3 = i2 ; i3 < n ; i3 ++ ) { int o1 = ( arr1 [ i2 ] > arr1 [ i3 ] ) ? ( arr1 [ i2 ] ) : ( arr1 [ i3 ] ) ; arr1 [ i3 ] = ( arr1 [ i2 ] < arr1 [ i3 ] ) ? ( arr1 [ i2 ] ) : ( arr1 [ i3 ] ) ; arr1 [ i2 ] = o1 ; } } largest = arr1 [ 0 ] ; smallest = arr1 [ n - 1 ] ; ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (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))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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))))) (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 (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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 (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) 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: (ternary_expression condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (parenthesized_expression (array_access array: (identifier) index: (identifier))) alternative: (parenthesized_expression (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (ternary_expression condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (parenthesized_expression (array_access array: (identifier) index: (identifier))) alternative: (parenthesized_expression (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))