#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
    char c,apple[6]="apple",peach[6]="peach";
    int appleCount=0,peachCount=0;
    while(true){
        c=getchar();
        if(c=='\n'){
            break;
        }
        putchar(c);
        if(appleCount>0){
            if(c==apple[appleCount]){
                appleCount++;
            }
            else{
                appleCount=0;
            }
        }
        else if(peachCount>0){
            if(c==peach[peachCount]){
                peachCount++;
            }
            else{
                peachCount=0;
            }
        }
        else if(c=='a'){
            appleCount++;
        }
        else if(c=='p'){
            peachCount++;
        }
        if(appleCount==5){
            cout<<'\b'<<'\b'<<'\b'<<'\b'<<'\b';
            cout<<"peach";
        }
        if(peachCount==5){
            cout<<'\b'<<'\b'<<'\b'<<'\b'<<'\b';
            cout<<"apple";
        }
    }
    cout<<endl;
    return 0;
}