-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = print . snd . foldl f (0, 0) . map read . tail . words =<< getContents where f (mx, ans) nm = (mx2, an2) where mx2 = maximum [mx, nm] an2 = if nm < mx2 && nm > ans then nm else ans