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

lstrip [] = []
lstrip xs'@(x:xs) | x == ' '  = lstrip xs
                  | otherwise = xs'

rstrip = reverse . lstrip . reverse
strip = lstrip . rstrip

replace = let 
        rel "peach" = "apple"
        rel "apple" = "peach"
        rel w = w
    in map rel

words' = map strip . groupBy (\x y -> y /= ' ' && y /= '.' && y/= ',')

unwords' [] = ""
unwords' [x] = x
unwords' (x:xs) = x ++ (until xs) ++ unwords' xs 
    where 
        until (s:ss) 
            | s == "." = ""
            | s == "," = ""
            | otherwise = " "

main :: IO ()
main = do
    s <- getLine
    putStrLn $ unwords' . replace . words' $ s
