Problem:


りんごと桃

福島県は果物の産地としても有名で、その中でも特に桃とりんごは全国でも指折りの生産量を誇っています。ところで、ある販売用の英文パンフレットの印刷原稿を作ったところ、手違いでりんごに関する記述と桃に関する記述を逆に書いてしまいました。

あなたは、apple と peach を修正する仕事を任されましたが、なにぶん面倒です。１行の英文を入力して、そのなかの apple という文字列を全て peach に、peach という文字列を全てapple に交換した英文を出力するプログラムを作成してください。

Input

英文（半角英数字、空白、記号を含む）が１行に与えられます。入力される文字列の長さは 1000 以下です。

Output

apple とpeach という文字列を交換した英文を１行に出力します。

Sample Input

the cost of one peach is higher than that of one apple.

Output for the Sample Input

the cost of one apple is higher than that of one peach.



Sample input:
the cost of one peach is higher than that of one apple.


Sample output:
the cost of one apple is higher than that of one peach.

Submission status: Accepted

Solution code:


sent = map(str, raw_input())

for i in range(len(sent)-4):
    if sent[i] == 'a' and sent[i+1] == 'p' and sent[i+2] == 'p' and sent[i+3] == 'l' and sent[i+4] == 'e':
        sent[i], sent[i+1], sent[i+2], sent[i+3], sent[i+4], = 'p','e','a','c','h'
    elif sent[i] == 'p' and sent[i+1] == 'e' and sent[i+2] == 'a' and sent[i+3] == 'c' and sent[i+4] == 'h':
        sent[i], sent[i+1], sent[i+2], sent[i+3], sent[i+4], = 'a','p','p','l','e'

 
print ''.join(sent)

Submission status: Accepted

Solution code:
s=raw_input()
for i in range(len(s)-4):
    if s[i:i+5]=="apple":
        s=s[:i]+"peach"+s[i+5:]
    elif s[i:i+5]=="peach":
        s=s[:i]+"apple"+s[i+5:]
print s

Submission status: Accepted

Solution code:
s=raw_input()
s=s.replace("apple","@#")
s=s.replace("peach","apple")
s=s.replace("@#","peach")
print s

Submission status: Accepted

Solution code:
print raw_input().replace("apple","(").replace("peach","apple").replace("(","peach")

Submission status: Accepted

Solution code:
print "peach".join(map(lambda x: x.replace("peach", "apple"), raw_input().split("apple")))

Submission status: Accepted

Solution code:

import sys


def solv(str):
    str = str.replace('apple', '_____')
    str = str.replace('peach', 'apple')
    str = str.replace('_____', 'peach')
    return str


for line in sys.stdin:
    line = line.rstrip('\n')
    print solv(line)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

for line in stdin:
    L = []
    for w in line.split():
        if 'apple' in w:
            L.append(w.replace('apple', 'peach'))
        elif 'peach' in w:
            L.append(w.replace('peach', 'apple'))
        else:
            L.append(w)
    print(*L)

Submission status: Accepted

Solution code:
import sys

d = raw_input()

for i in range(len(d)):
    if d[i:i+5] == "apple":
        d = d[:i] + "peach" + d[i+5:]
    elif d[i:i+5] == "peach":
	d = d[:i] + "apple" + d[i+5:]
print d

Submission status: Accepted

Solution code:
print raw_input().replace('apple', '{}').replace('peach', 'apple').replace('{}', 'peach')

Submission status: Accepted

Solution code:
print raw_input().replace("apple","%").replace("peach","apple").replace("%","peach")

Submission status: Accepted

Solution code:
a="apple"
b="peach"
s=raw_input().replace(a,"X").replace(b,a).replace("X",b)
print s

Submission status: Accepted

Solution code:
a="apple"
b="peach"
print raw_input().replace(a,"X").replace(b,a).replace("X",b)

Submission status: Accepted

Solution code:
msg = raw_input()
for i in range(len(msg)-4):
    if msg[i:i+5] == "apple":
        msg = msg[:i] + "peach" + msg[i+5:]
    elif msg[i:i+5] == "peach":
        msg = msg[:i] + "apple" + msg[i+5:]
print msg

Submission status: Accepted

Solution code:
from itertools import *

try:
    while True:
        a, p = 'apple', 'peach'
        b = raw_input()
        for i in count(0):
            if i >= len(b): break
            if b[i:i + len(a)] == a:
                b = b[:i] + p + b[i + len(a):]
            elif b[i:i + len(p)] == p:
                b = b[:i] + a + b[i + len(p):]
        print b
except EOFError:
    pass

Submission status: Accepted

Solution code:
print raw_input().replace('peach', 'HOGEHOGE').replace('apple', 'peach').replace('HOGEHOGE', 'apple')

Submission status: Accepted

Solution code:
print(input().replace('apple','@').replace('peach', 'apple').replace('@', 'peach'))

Submission status: Accepted

Solution code:
def aaa(aa):
    return aa.replace('apple', 'peach')
def bbb(bb):
    return bb.replace('peach', 'apple')


a=raw_input().split()
b = 0
for i in a:
    if 'apple' in i:
        i=aaa(i)
        a[b] = i
        b+=1
        continue

    if 'peach' in i:
        i = bbb(i)
        a[b] = i
        b+=1
        continue
    b+=1

print " ".join(a)

Submission status: Accepted

Solution code:
word = input()
word = word.replace('apple','%a%')
word = word.replace('peach','%p%')
word = word.replace('%p%','apple')
word = word.replace('%a%','peach')
print(word)

Submission status: Accepted

Solution code:
s = input()
a = s.replace('apple', 'orange')
b = a.replace('peach', 'apple')
c = b.replace('orange', 'peach')
print(c)

Submission status: Accepted

Solution code:
s = str(input())
s = s.replace('apple', '-')
s = s.replace('peach', 'apple')
s = s.replace('-', 'peach')
print(s)

Submission status: Accepted

Solution code:
n=input()
n=n.replace('apple','x')
n=n.replace('peach','apple')
n=n.replace('x','peach')
print(n)

Submission status: Accepted

Solution code:
a = input()
a=a.replace('apple','AAAAA')
a=a.replace('peach','apple')
a=a.replace('AAAAA','peach')
print(a)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


n=input()

n=n.replace('apple','tmp')
n=n.replace('peach','apple')
print(n.replace('tmp','peach'))

Submission status: Accepted

Solution code:
l = str(input());
a = l.replace('apple', 'aa').replace('peach', 'apple');
print(a.replace('aa', 'peach'));

Submission status: Accepted

Solution code:
a=list(map(str,input().split()))
for i in range(len(a)):
    if "peach" in a[i]:
        a[i]=a[i].replace("peach", "apple")
    elif "apple" in a[i]:
        a[i]=a[i].replace("apple", "peach")
print(*a)

Submission status: Accepted

Solution code:
i=input()
print(i.replace('apple','x').replace('peach','apple').replace('x','peach'))

Submission status: Accepted

Solution code:
Eng=input()
print(Eng.replace('peach', 'X').replace('apple', 'peach').replace('X', 'apple'))

Submission status: Accepted

Solution code:
a = str(input())
b = a.replace('apple','X').replace('peach','apple').replace('X','peach')
print(b)

Submission status: Accepted

Solution code:
s = input()
s=s.replace("apple","り")
s=s.replace("peach","apple")
s=s.replace("り","peach")
print(s)

Submission status: Accepted

Solution code:
n = input().split()
for i in range(len(n)) :
    if "apple" in n[i] :
        n[i] = n[i].replace("apple", "peach")
    elif "peach" in n[i] :
        n[i] = n[i].replace("peach", "apple")
print(*n)

Submission status: Accepted

Solution code:
s=str(input())
s=s.replace('apple', '_')
s=s.replace('peach', 'apple')
s=s.replace('_', 'peach')
print(s)

Submission status: Accepted

Solution code:
w=input()

w1=w.replace('peach','X')


w2=w1.replace('apple','Y')


w3=w2.replace('X','apple')
w4=w3.replace('Y','peach')
print(w4)

Submission status: Accepted

Solution code:
s=list(str(input()))
for i in range(len(s)-4):
    if s[i]=='a' and s[i+1]=='p' and s[i+2]=='p' and s[i+3]=='l' and s[i+4]=='e':
        s[i]='p'
        s[i+1]='e'
        s[i+2]='a'
        s[i+3]='c'
        s[i+4]='h'
    elif s[i]=='p' and s[i+1]=='e' and s[i+2]=='a' and s[i+3]=='c' and s[i+4]=='h':
        s[i]='a'
        s[i+1]='p'
        s[i+2]='p'
        s[i+3]='l'
        s[i+4]='e'
print(''.join(s))

Submission status: Accepted

Solution code:
n = input()
print(n.replace('apple', 'X').replace('peach', 'apple').replace('X', 'peach'))

Submission status: Accepted

Solution code:
string = input()
string = string.replace("apple","_apple").replace("peach","_peach").replace("_peach","apple").replace("_apple","peach")
print(string)

Submission status: Accepted

Solution code:
a=input()
a=a.replace('apple','momo')
a=a.replace('peach','apple')
a=a.replace('momo','peach')
print(a)

Submission status: Accepted

Solution code:
x=input()
print(x.replace("peach","X").replace("apple","peach").replace("X","apple"))

Submission status: Accepted

Solution code:
s=input()
s=s.replace('apple', 'AAAAA')
s=s.replace('peach', 'apple')
s=s.replace('AAAAA', 'peach')
print(s)

Submission status: Accepted

Solution code:

tmp = input()

tmp = tmp.replace("apple","@")
tmp = tmp.replace("peach","apple")
tmp = tmp.replace("@","peach")

print(tmp)

Submission status: Accepted

Solution code:
s=input()
s=s.replace('apple', 'rrrrrrrrrrrrrrrrrr')
s=s.replace('peach','apple')
s=s.replace('rrrrrrrrrrrrrrrrrr','peach')
print(s)

Submission status: Accepted

Solution code:
s = input()
s = s.replace("apple", "x")
s = s.replace("peach", "apple")
s = s.replace("x", "peach")
print(s)

Submission status: Accepted

Solution code:
L=input()
L=L.replace("apple","kunimatsu")
L=L.replace("peach","apple")
L=L.replace("kunimatsu","peach")

print(L)

Submission status: Accepted

Solution code:
x=input()

x = x.replace('apple', 'tmp')
x = x.replace('peach', 'apple')
x = x.replace('tmp', 'peach')

print(x)

Submission status: Accepted

Solution code:
d = input()
print(d.replace('apple', 'X').replace('peach', 'apple').replace('X', 'peach'))

Submission status: Accepted

Solution code:
#0050
word = input()
words = word.replace('peach','X').replace('apple','peach').replace('X','apple')
print(words)

Submission status: Accepted

Solution code:
a=input()
a1=a.replace("apple","x")
a2=a1.replace("peach","apple")
a3=a2.replace("x","peach")
print(a3)

Submission status: Accepted

Solution code:
x = input()

x = x.replace('apple', 'ringo')
x = x.replace('peach', 'apple')
x = x.replace('ringo', 'peach')

print(x)

Submission status: Accepted

Solution code:
lst = list(input().split())
for num, i in enumerate(lst):
    if 'apple' in i:
        n = i.find('apple')
        lst[num] = i[:n] +'peach' + i[n+5:]

    elif 'peach' in i:
        n = i.find('peach')
        lst[num] = i[:n] + 'apple' + i[n+5:]
    
    else:
        pass

print(*lst)

Submission status: Accepted

Solution code:
x=input()
print(x.replace("peach","X").replace("apple","peach").replace("X","apple"))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s = input()
print(s.replace("apple", "あ").replace("peach", "apple").replace("あ", "peach"))

Submission status: Accepted

Solution code:
a=input()
b=a.replace('apple','&')
c=b.replace('peach','apple')
d=c.replace('&','peach')
print(d)

Submission status: Accepted

Solution code:
x = input()

x = x.replace('apple', '___')
x = x.replace('peach', 'apple')

print(x.replace('___', 'peach'))

Submission status: Accepted

Solution code:
text = input()

text = text.replace('apple', 'ringo')
text = text.replace('peach', 'apple')
text = text.replace('ringo', 'peach')

print(text)

Submission status: Accepted

Solution code:
try:
    s = input()
    s = s.replace('apple','xxxxx')
    s = s.replace('peach','apple')
    s = s.replace('xxxxx','peach')
    print(s)
except:
    print('')

Submission status: Accepted

Solution code:
a = input()

a = a.replace("apple","*")
a = a.replace("peach","apple")
a = a.replace("*","peach")
print(a)

Submission status: Accepted

Solution code:
bun=input()
print(bun.replace("apple", "KKKK").replace("peach", "apple").replace("KKKK", "peach"))

Submission status: Accepted

Solution code:
s=input()
print(s.replace('peach', 'X').replace('apple', 'peach').replace('X', 'apple'))

Submission status: Accepted

Solution code:
n = input()

n = n.replace('apple','x')
n = n.replace('peach','apple')
n = n.replace('x','peach')

print(n)

Submission status: Accepted

Solution code:
A = list(input().split())
for i in range(len(A)) :
    if "apple" in A[i] :
        A[i] = A[i].replace("apple", "peach")
    elif "peach" in A[i] :
        A[i] = A[i].replace("peach", "apple")

print(" ".join(A))

Submission status: Accepted

Solution code:
input_str = input()

str_len = len(input_str)
index = 0

while index < str_len:
    if input_str[index:].startswith('apple'):
        print('peach', end='')
        index += 5
    elif input_str[index:].startswith('peach'):
        print('apple', end='')
        index += 5
    else:
        print(input_str[index], end='')
        index += 1

    if (index == str_len):
        print('')

Submission status: Accepted

Solution code:
s = input()
S = []

a = "apple"
p = "peach"
A = []
P = []

for i in range(len(s)) :
    S.append(s[i])
    
for i in range(5) :
    A.append(a[i])
    P.append(p[i])

for i in range(len(S)) :
    if S[i : i + 5] == A :
        S[i : i + 5] = P
    elif S[i : i + 5] == P :
        S[i : i + 5] = A
        
for i in range(len(S)) :
    if i == len(S) - 1 :
        print(S[i])
    else :
        print(S[i], sep = "", end = "")

Submission status: Accepted

Solution code:
str1 = input() #標準入力
str1 = str1.replace("apple","kari") #"apple"を"kari"に変換する
str1 = str1.replace("peach","apple") #"peach"を"apple"に変換する
str1 = str1.replace("kari","peach") #"kari"を"peach"に変換する
print(str1) #出力

Submission status: Accepted

Solution code:
s=input()
s=s.replace('apple','X').replace('peach','apple').replace('X','peach')
print(s)

Submission status: Accepted

Solution code:
s=input()

s=s.replace("peach","@@@@@@@")
s=s.replace("apple","peach")
s=s.replace("@@@@@@@","apple")

print(s)

Submission status: Accepted

Solution code:
print(input().replace("apple","_").replace("peach","apple").replace("_","peach"))

Submission status: Accepted

Solution code:
def retry(sen):
    sen=sen.replace('apple','-----')
    sen=sen.replace('peach','apple')
    print(sen.replace('-----','peach'))

sen_2=input()
#sen=list(map(str,input().split()))
#for i in range(len(sen)):
#    if i<len(sen)-1:
#        if sen[i]=='apple' or sen[i]=='peach':
#            if sen[i]=='peach':
#                print('apple',end=" ")
#            else:
#                print('peach',end=" ")
#        else:
#            print(sen[i],end=" ")
#    else:
#        if sen[i]=='apple.' or sen[i]=='peach.':
#            if sen[i]=='peach.':
#                print('apple.')
#            else:
#                print('peach.')
#        else:
#            print(sen[i])
    
retry(sen_2)

Submission status: Accepted

Solution code:
s = input()
s = s.replace("peach", "XXXXX")
s = s.replace("apple", "peach")
s = s.replace("XXXXX", "apple")
print(s)

Submission status: Accepted

Solution code:
s = input()
s=s.replace('apple', '#')
s=s.replace('peach', 'apple')
s=s.replace('#', 'peach')

print(s)

Submission status: Accepted

Solution code:
s = input()

s = s.replace('apple', '%a%')
s = s.replace('peach', '%p%')
s = s.replace('%a%', 'peach')
s = s.replace('%p%', 'apple')

print(s)

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

S = input()

S = S.replace('apple', '1145141919')
S = S.replace('peach', 'apple')
S = S.replace('1145141919', 'peach')

print(S)

Submission status: Accepted

Solution code:
s = input()
s = s.replace("apple", "..........")
s = s.replace("peach", "apple")
s = s.replace("..........", "peach")
print(s)

Submission status: Accepted

Solution code:
print(input().replace('apple','*').replace('peach','apple').replace('*','peach'))

Submission status: Accepted

Solution code:
s=input()
s=s.replace('apple', 'AAAAA')
s=s.replace('peach', 'apple')
s=s.replace('AAAAA', 'peach')
print(s)

Submission status: Accepted

Solution code:
s = input()

s = s.replace('apple', '%a%')
s = s.replace('peach', '%p%')
s = s.replace('%a%', 'peach')
s = s.replace('%p%', 'apple')

print(s)

Submission status: Accepted

Solution code:
text = input()
text = text.replace("apple","temp_")
text = text.replace("peach","apple")
text = text.replace("temp_","peach")
print(text)

Submission status: Accepted

Solution code:
sentence = input()

sentence = sentence.replace("apple", "hogehoge")
sentence = sentence.replace("peach", "apple")
sentence = sentence.replace("hogehoge", "peach")

print(sentence)

Submission status: Accepted

Solution code:
s = input()
s = s.replace('apple', '_')
s = s.replace('peach', 'apple')
s = s.replace('_', 'peach')
print(s)

Submission status: Accepted

Solution code:
print(input().replace("peach","asdf:*O`P*P+").replace("apple","peach").replace("asdf:*O`P*P+","apple"))

Submission status: Runtime Error

Solution code:
print raw_input().replace("apple", "!#$%!"#$").replace("peach", "apple").replace("!#$%!"#$", "peach")

Submission status: Runtime Error

Solution code:
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)

Submission status: Runtime Error

Solution code:
import re
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)

Submission status: Runtime Error

Solution code:
import string
sen=map(str,raw_input().split())
ans=[]
for i in sen:
    if i[0:5]=="apple":
        if len(i)>5:
            ans.append("peach"+i[5:])
        else:
            ans.appned("peach")
    elif i[0:5]=="peach":
        if len(i)>5:
            ans.append("apple"+i[5:])
        else:
            ans.append("apple")
    else:
        ans.append(i)
print(" ".join(ans))

Submission status: Runtime Error

Solution code:
sen=map(str,raw_input().split())
ans=[]
for i in sen:
    if len(i)>=5:
        if i[0:5]=="apple":
            if len(i)>5:
                ans.append("peach"+i[5:])
            else:
                ans.appned("peach")
        elif i[0:5]=="peach":
            if len(i)>5:
                ans.append("apple"+i[5:])
            else:
                ans.append("apple")
        else:
            ans.append(i)
    else:
        ans.append(i)
print(" ".join(ans))

Submission status: Runtime Error

Solution code:
sentence = input().split()
# sentence = 'the cost of one peach is higher than that of one apple.'.split()


def converter(s):
    if 'apple' == s or 'apple.' == s:
        return s.replace('apple', 'peach')
    elif 'peach' == s or 'peach.' == s:
        return s.replace('peach', 'apple')

print(' '.join(map(converter, sentence)), end='')

Submission status: Runtime Error

Solution code:
s = input().split()
ss = []
for w in s:
    a = w.find('apple')
    p = w.find('peach')
    if a != -1:
        w = w.replace('apple','peach')
    elif p != -1:
        w = w.replace('peach','apple')
    ss.append(word)
print(' '.join(ss))

Submission status: Runtime Error

Solution code:
a,p='apple','peach'
t={a:p,p:a}
print(*[t[w]if 5==len(w)and if w in t else t[w[:5]]+w[5:]if w[:5]in t else w for w in input().split()])