#encoding:utf-8 No.0050 2014.10.7
while true
  sentence = gets.chomp.split
  if sentence == []
    break
  end

  sentence.length.times do |i|
    if /apple/ =~ sentence[i]
      sentence[i].gsub!(/apple/,"peach")
    elsif /peach/ =~ sentence[i]
      sentence[i].gsub!(/peach/,"apple")
    end

    print sentence[i] + " "
    if i == sentence.length - 1
      print "\n"
    end
  end
end