import Data.List (sort, and, find)

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    ns <- sort .  map read . lines <$> getContents :: IO [Integer]
    mapM_ print ns
    let ms = map (* last ns) [1..] :: [Integer]
    let o =  find (\x -> and $ map (\y -> mod x y == 0) ns) ms
    putStrLn . show $ fromJust o 

fromJust (Just x) = x