main = getLine >>= switchAP >>= putStrLn

switchAP :: String -> IO String
switchAP = return . unwords.foldr ((:).switchAP') [].words 

switchAP' :: String -> String
switchAP' x
  | x == "apple" = "peach"
  | x == "peach" = "apple"
  | otherwise    = x