let replace s =
  let s1 = Str.global_replace (Str.regexp "apple") "PEACH" s in
  let s2 = Str.global_replace (Str.regexp "peach") "apple" s1 in
  Str.global_replace (Str.regexp "PEACH") "peach" s2

let _ = 
  let s = read_line () in
  print_endline (replace s)
  