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