a = gets.split(" ")
sw = {"apple" => "peach", "peach" => "apple", "Apple" => "Peach", "Peach" => "Apple", "APPLE" => "PEACH", "PEACH" => "APPLE" }
a.each_with_index {|ai,i|
	ap = ai.index("'")
	if ai[-1] == "." || ai[-1] == "," || ai[-1] == "!" || ai[-1] == "?" 
		if ai[-2] == "s" || ai[-2] == "S"
			if sw[ai[0..4]]
				if ap
					a[i] = sw[ai[0..4]] + "'" + ai[-2] + ai[-1]
					else
					a[i] = sw[ai[0..4]] + ai [-2] + ai[-1]
					if a[i][-3..-2] == "hs"
						a[i] = a[i].gsub("s", "es")
					elsif a[i][-3..-2] == "HS"
						a[i] = a[i].gsub("S", "ES")
					end
				end
			end
		elsif sw[ai[0..-2]]
			a[i] = sw[ai[0..-2]] + ai[-1]
		end
	elsif ai[-1] == "s" || ai[-1] == "S"
		if sw[ai[0..4]]
			if ap
				a[i] = sw[ai[0..4]] + "'" + ai[-1]
			else
				a[i] = sw[ai[0..4]] + ai[-1]
				if a[i][-2..-1] == "hs"
					a[i] = a[i].gsub("s", "es")
				elsif a[i][-2..-1] == "HS"
					a[i] = a[i].gsub("S", "ES")
				end
			end
		end
	elsif sw[ai]
		a[i] = sw[ai]
	end
}
puts a.join(" ")