#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<algorithm>

int main()
{
	const std::string p="peach", a="apple", tempWord="---";

	std::string str;

	std::vector<std::string> words;

	std::stringstream ss;

	while(1)
	{
		if(std::cin.eof())
		{
			break;
		}

		std::getline(std::cin,str);

		const size_t periodNum = str.length()-1;

		std::string period = "";

		if(!('A'<=str[periodNum] && str[periodNum]<='z'))
		{

			period = str[periodNum];

			str.erase(periodNum);

		}

		ss << str;

		while(1)
		{
			std::string word;

			ss >> word;

			words.push_back(word);

			if(ss.eof())
			{
				break;
			}

		}

//for_eachで一気に書ける？
		std::replace_if(words.begin(), words.end(),[p](std::string w){return w==p;},tempWord);

		std::replace_if(words.begin(), words.end(),[a](std::string w){return w==a;},p);

		std::replace_if(words.begin(), words.end(),[tempWord](std::string w){return w==tempWord;},a);

		//std::for_each(words.begin(),words.end(),[](std::string w){std::cout << w << ' ';});

		words[words.size()-1] += period;

		for(size_t i=0; i<words.size(); ++i)
		{
			std::cout << words[i] << ' ';
		}

		std::cout << '\n'; 

		ss.str("");

		ss.clear();

		words.clear();

		str.clear();
	}
}