text = gets.chomp

offset = 0
loop do
  a = text.index("apple", offset)
  b = text.index("peach", offset)

  if a && b
    if a < b
      offset = a + 1
      text[a,5] = "peach"
    else
      offset = b + 1
      text[a,5] = "apple"
    end
  elsif a
    text[a,5] = "peach"
    offset = a + 1
  elsif b
    text[b,5] = "apple"
    offset = b + 1
  else
    break
  end
end

puts text