#include<iostream>
#include<string>

using namespace std;

int main() {
	
	string a;
	
	getline(cin, a);
	
	int i=0;
	
	for(;;) {
        int j = a.find("apple", i);
        int k = a.find("peach", i);
        
        if(j == string::npos && k == string::npos)
            break;
            
        if(k == string::npos || (j != string::npos && j < k)) {
        	
            a.replace(j, 5, "peach");
            i = j + 5;
            
        }
        
		else {
			
            a.replace(k, 5, "apple");
            i = k + 5;
            
        }
    }
    
	cout << a << "\n";
	
		
	return 0;
}

