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



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

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

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

    output = input.join(" ");
    writeln(output, ".");
}