public static void main ( String [ ] args ) {
  boolean [ ] sieve = new boolean [ 200001 ] ;
  ArrayList < Integer > primes = new ArrayList < > ( ) ;
  for ( int i = 2 ;
  i <= 200000 ;
  i ++ ) {
    if ( ! sieve [ i ] ) {
      primes . add ( i ) ;
      for ( int j = i ;
      j <= 200000 ;
      j += i ) {
        sieve [ j ] = true ;
      }
    }
  }
  Scanner in = new Scanner ( System . in ) ;
  int N = in . nextInt ( ) ;
  int [ ] arr = new int [ N ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    arr [ i ] = in . nextInt ( ) ;
  }
  long res = 1 ;
  for ( int p : primes ) {
    int min = Integer . MAX_VALUE ;
    int min2 = Integer . MAX_VALUE ;
    for ( int i : arr ) {
      int count = count ( i , p ) ;
      if ( count < min2 ) {
        min2 = Math . max ( min , count ) ;
      }
      if ( count < min ) {
        min = count ;
      }
      if ( min2 == 0 ) {
        break ;
      }
    }
    res *= ( long ) Math . pow ( p , min2 ) ;
  }
  System . out . println ( res ) ;
}

public static void main ( String [ ] args ) { boolean [ ] sieve = new boolean [ 200001 ] ; ArrayList < Integer > primes = new ArrayList < > ( ) ; for ( int i = 2 ; i <= 200000 ; i ++ ) { if ( ! sieve [ i ] ) { primes . add ( i ) ; for ( int j = i ; j <= 200000 ; j += i ) { sieve [ j ] = true ; } } } Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int [ ] arr = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { arr [ i ] = in . nextInt ( ) ; } long res = 1 ; for ( int p : primes ) { int min = Integer . MAX_VALUE ; int min2 = Integer . MAX_VALUE ; for ( int i : arr ) { int count = count ( i , p ) ; if ( count < min2 ) { min2 = Math . max ( min , count ) ; } if ( count < min ) { min = count ; } if ( min2 == 0 ) { break ; } } res *= ( long ) Math . pow ( p , min2 ) ; } System . out . println ( res ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (boolean_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (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)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (array_access array: (identifier) index: (identifier)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))))))))) (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: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) 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)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (break_statement))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))