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

int main() {

  string input;
  getline( cin, input );
  string ans = input;

  string apple = "apple";
  string peach = "peach";

  while(true) {

    int x = input.find( apple, 0 );
    if ( x == string::npos ) break;
    for ( int i = 0; i < 5; i++ ) {
      ans[x+i] = peach[i];
      input[x+i] = '-';
    }
    cout << x << endl;

  }

  while(true) {

    int x = input.find( peach, 0 );
    if ( x == string::npos ) break;
    for ( int i = 0; i < 5; i++ ) {
      ans[x+i] = apple[i];
      input[x+i] = '-';
    }

  }

  cout << ans << endl;

  return 0;

}