#include<iostream>
#include<string>
#include<sstream>
using namespace std;
string s, w[1000];
stringstream ss;
int i;

int main() {
	getline(cin, s);
	ss << s;
	for (i = 0; ss >> w[i]; i++) {
		int p = w[i].find("apple"), q = w[i].find("peach");
		if (p != string::npos) {
			w[i].replace(p, 5, "peach");
		}
		if (q != string::npos) {
			w[i].replace(q, 5, "apple");
		}
	}
	for (int j = 0; j < i; j++) {
		if (j)cout << " ";
		cout << w[j];
	}
	cout << endl;
}
