solve :: String -> String
solve = unwords . map f . words
  where f "apple"  = "peach"
        f "apple." = "peach."
        f "peach"  = "apple"
        f "peach." = "apple."
        f s        = s

main :: IO ()
main = getContents >>= mapM_ (putStrLn . solve) . lines