-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = print . snd . foldr f (0, 0) . map read . reverse . tail . words =<< getContents where f nm (mx, ans) = if nm > mx then (nm, ans) else if nm > ans then (mx, nm) else (mx, ans)