#include <string>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <utility>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iterator>
#include <sstream>

using namespace std;
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<class T>
void splitstr(const string &s, vector<T> &out)
{
    istringstream in(s);
    out.clear();
    copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
int main()
{
	string s; getline(cin,s);
	vector<string> spl;
	splitstr(s,spl);
	for (int i = 0; i < (int)spl.size(); i++){
		bool end_with_dot = false;
		if(spl[i][spl[i].size()-1] == '.'){
			end_with_dot = true; spl[i].erase(spl[i].end() - 1,spl[i].end());
		}
		if(string::npos != spl[i].find("peach")) spl[i] = "apple";
		else if(string::npos != spl[i].find("apple")) spl[i] = "peach";
		if(end_with_dot) spl[i].push_back('.');
	}

	for(int i= 0;i < (int)spl.size(); i++){
		printf("%s%c",spl[i].c_str(),i == (int)spl.size()-1 ? '\n' : ' ');
	}
	return 0;
}