#include <iostream>
using namespace std;

int main() {
  string str,sentence[1000];
  int i=0;
  while(cin >> str) {
    if(str == "apple")
      str = "peach";
    else if(str == "peach")
      str = "apple";
    sentence[i] = str;
    i++;
  }
  for(int k=0;k<i-1;k++)
    cout << sentence[k] << " ";
  cout << sentence[i-1] << endl;
}