main :: IO()
main = do
    [a,b,c] <- map read . words <$> getLine
    print $ getsolve a b c
    
    
getsolve :: Int -> Int -> Int -> Int
getsolve a b c
    | a == b		= c
    | otherwise		= getsolve c a b