#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	vector<string> sentence, sen;
	string s;
	while(cin >> s){
		if(s.find("peach") != s.npos)
			sentence.push_back("apple");
		else if(s.find("apple") != s.npos)
			sentence.push_back("peach");
		else
			sentence.push_back(s);
	}
		vector<string>::iterator it2 = sentence.begin();
		while(it2 != sentence.end()){
			cout << *it2 << " ";
			++it2;
		}
		cout << endl;
}