st = $<.gets.chomp
po = 0
result = ""
while po < st.length
  case st[po, 5]
  when "apple"
    result += "peach"
    po += 5
  when "peach"
    result += "apple"
    po += 5
  else
    result += st[po]
    po += 1
  end
end
puts result
