import std.stdio;
import std.conv;
import std.regex;
import std.array;



void main() {
    string[] input; 
    string output;
    int[] apple, peach;

    input = readln.split(regex(" "));

    foreach (i; 0..input.length) {
        if (input[i].match(regex("apple"))) apple ~= i.to!int;
        if (input[i].match(regex("peach"))) peach ~= i.to!int;
    }
    foreach (i; apple) input[i] = input[i].replace("apple", "peach");
    foreach (i; peach) input[i] = input[i].replace("peach", "apple");

    output = input.join(" ");
    write(output);
}