main = do
    n <- getLine
    xs <- map (read ::String -> Int) . words <$> getLine
    let left = scanl gcd 0 xs
    let right = scanr gcd 0 xs
    print left
    print right
    print $ maximum $ zipWith gcd left (tail right)


