import Data.List main = interact $ unlines . solve . tail . words solve (x:xs) = if (length ys) == 2 then ys else solve ys where ys = deleteBy (==) x xs