import Control.Monad
import Data.List
import Control.Applicative

solver :: [Int] -> [Int]
solver = (\\) [1..30]


main :: IO()
main = do
  contents <- map (read :: String -> Int) <$> replicateM 28 getLine
  let (x1:x2:_) = solver contents
  if x1 < x2
    then mapM_ print [x1, x2]
    else mapM_ print [x2, x1]