import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    n <- fst . fromJust . B.readInt <$> B.getLine
    ts <- replicateM n $ fst . fromJust . B.readInteger <$> B.getLine
    print $ maximum [lcm x y | x <- ts, y <- ts]
