module Main where import Control.Monad main :: IO () main = do [sa, pa, _] <- words <$> getLine [sb, pb, _] <- words <$> getLine case (read pa :: Integer) `compare` (read pb) of LT -> putStrLn sb GT -> putStrLn sa EQ -> print (-1)