#include<iostream>
#include<string>
using namespace std;
int main() {
	for (string s ; ;cin >> s ){
		if (s == "peach")
			cout << "apple";
		else if (s == "apple") 
			cout << "peach";
		else cout << s;
		cout << ' ';
	}
	cout << endl;
	char c;
	cin >> c;
	return 0;
}