#encoding:utf-8 No.0050 2014.10.7
while gets
  sentence = $_.chomp.split
  
  sentence.length.times do |i|
    if /apple/ =~ sentence[i]
      sentence[i].gsub!(/apple/,"peach")
    elsif /peach/ =~ sentence[i]
      sentence[i].gsub!(/peach/,"apple")
    end
  end
end

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