#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
  string s,a="apple",p="peach";
  vector<string> v;
  while(cin>>s){
    if(s.size()>=5){
      if(!(a.compare(s.substr(0,5))))s="peach";
      if(!(p.compare(s.substr(0,5))))s="apple";
    }
    v.push_back(s);
    if(s[s.size()-1]=='.'){
    vector<string>::iterator it = v.begin();
    while(it!=v.end()){
    cout<<*it;
    (it+1==v.end())?cout<<endl:cout<<" ";
    it++;
    }
    return 0;}
  }
}