import Data.List
main = getLine >>= switchAP >>= putStrLn

switchAP :: String -> IO String
switchAP x = return $ switchAP' x

switchAP' = replace "x" "apple".replace "apple" "peach".replace "peach" "x"

replace old new = join new.split old

join a b = concat (intersperse a b)

split :: Eq a => [a] -> [a] -> [[a]]
split _ [] = []
split delim str =
    let (firstline, remainder) = spanList (not.isPrefixOf delim) str
        in 
        firstline : case remainder of
                                   [] -> []
                                   x -> if x == delim
                                        then [] : []
                                        else split delim 
                                                 (drop (length delim) x)
spanList :: ([a] -> Bool) -> [a] -> ([a], [a])
spanList _ [] = ([],[])
spanList func list@(x:xs) =
    if func list
       then (x:ys,zs)
       else ([],list)
    where (ys,zs) = spanList func xs