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

int main() {
  int n = 0;
  string a[1000];
  while(cin >> a[n]){
    if(a[n] == "apple"){
      a[n] = "peach";
    }else if (a[n] == "peach"){
      a[n] = "apple";
    }
      n++;
  }
  for(int i=0; i<n-1; i++){
    cout << a[i] <<" ";
  }
  cout << a[n-1] <<"."<<endl;
  return 0;
}
