
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int i=-1,j=0,memo,mem;
    string str[10000]={""};//?????????
    char ch[10000];
    while(true){
        i++;
        scanf("%c",&ch[i]);
        if(ch[i]=='\n'){
            memo=j;
            break;
        }
        if(ch[i]==' '){
            j++;
        }
        else{
            str[j]+=ch[i];
        }
    }
    for(int k=0;k<=memo+1;k++){
        mem=str[k].find("apple");
        if(mem!=-1){
            str[k].replace(mem,5,"peach");
        }
        else{
            mem=str[k].find("peach");
        if(mem!=-1){
            str[k].replace(mem,5,"apple");
        }
        }
    }
    for(int k=0;k<=memo+1;k++){
        if(k==memo+1){
        cout<<str[k]<<endl;
        }
        else{
            cout<<str[k]<<" ";
        }
    }
    return 0;
}