main :: IO () main = do input_line <- getLine let king = map read (words input_line) :: [Int] let kingx = king !! (0) let kingy = king !! (1) input_line2 <- getLine let destinaion = map read (words input_line2) :: [Int] let destinaionx = destinaion !! (0) let destinaiony = destinaion !! (1) putStrLn $ show (moving kingx kingy destinaionx destinaiony) return () moving :: Int -> Int -> Int -> Int -> Int moving a b c d | a == b && c == d && a > c = a + 1 | otherwise = max a b