#include <iostream>
#include <string>
using namespace std;

int main() {
	string input;
	while(cin>>input) {
		if(input=="peach") {
			cout<<"apple"<<" ";
		}
		else if(input=="apple") {
			cout<<"peach"<<" ";
		}
		else {
			cout<<input<<" ";
		}
	}
	cout<<endl;
	return 0;
}