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