import qualified Data.List as L main :: IO () main = do n <- getLine let ss = map read .L.permutations $ n a = foldr1 gcd ss putStrLn . show $ a