words = STDIN.gets.chomp.split(" ")
words.map! { |word| if word.include?("apple") then word.gsub(/apple/, "peach") elsif word.include?("peach") then word.gsub(/peach/, "apple") else word end }
puts words.join(" ")