main = do
    n <- readLn
    xs <- map (read::String -> Int) . words <$> getLine
    print (func n (xs++xs))

func :: Int -> [Int] -> [Int]
func n xs
    | n < (length xs) - 1 = foldr1 gcd (take (n - 1) xs) : func n (tail xs)
    | otherwise = []

