-- yukicoder My Practice -- author: Leonardone @ NEEDSDKASU -- スマホから投稿テスト import Data.List main = do ab <- getLine putStrLn $ solve ab solve ab = let (a:b:_) = words ab f (x:xs) (y:ys) = case (x, y) of ('7', '4') -> False ('4', '7') -> True _ -> case compare x y of LT -> False EQ -> f xs ys GT -> True f _ _ = True la = length a lb = length b r = case compare la lb of LT -> False EQ -> f a b GT -> True in if r then a else b