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: Wrong Answer

Solution code:
w=str(input())
print(len(w))
for i in range(len(w)):
    if i>len(w):break
    if w[i]=="a" and w[i+1]=="p" and w[i+2]=="p" and w[i+3]=="l" and w[i+4]=="e":
        w=w[:i]+"peach"+w[i+5:]
        continue
    if w[i]=="p" and w[i+1]=="e" and w[i+2]=="a" and w[i+3]=="c" and w[i+4]=="h":
        w=w[:i]+"apple"+w[i+5:]
print(w)

Submission status: Wrong Answer

Solution code:
ls = raw_input().split()
for i in range(len(ls)):
    if ls[i] == 'apple':
        ls[i] = 'peach'
    elif ls[i] == 'peach':
        ls[i] = 'apple'
print ' '.join(map(str,ls))

Submission status: Wrong Answer

Solution code:
ls = map(str,raw_input().split())
for i in range(len(ls)):
    if ls[i][:5] == 'apple':
        ls[i] = 'peach' + ls[i][5:]
    elif ls[i][:5] == 'peach':
        ls[i] = 'apple' + ls[i][5:]
print ' '.join(map(str,ls))

Submission status: Wrong Answer

Solution code:
s = raw_input()
s.replace("peach", "TTT")
s.replace("apple", "peach")
s.replace("TTT", "apple")

print s

Submission status: Wrong Answer

Solution code:
s = raw_input()
s.replace(" peach", " TTT")
s.replace(" apple", " peach")
s.replace(" TTT", " apple")

print s

Submission status: Wrong Answer

Solution code:
while True:
    try:
        sentence = raw_input().rstrip('.').split()
        for index, string in enumerate(sentence):
            if string == 'peach':
                sentence[index] = 'apple'
            elif string == 'apple':
                sentence[index] = 'peach'
        else:
            print ' '.join(sentence) + '.'
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        sentence = raw_input().rstrip('.').split()
        for index, string in enumerate(sentence):
            if 'peach' in string:
                s = string.find('peach')
                sentence[index] = string[:s] + 'apple' + string[s+5:]
            elif 'apple' in string:
                s = string.find('apple')
                sentence[index] = string[:s] + 'peach' + string[s+5:]
        else:
            print ' '.join(sentence) + '.'
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
l=map(str,raw_input().split())
for i,j in enumerate(l):
    if j=='paech':
        l[i]='apple'
    elif j=='apple':
        l[i]='peach'
print ' '.join(l)

Submission status: Wrong Answer

Solution code:
string=input()
print(string)
string1=string.replace('peach','tmp')
string2=string1.replace('apple','peach')
string3=string2.replace('tmp','apple')
print(string3)

Submission status: Wrong Answer

Solution code:
word = raw_input()
word = word[:-1].split()
print word
for i in xrange(len(word)):
	if "apple" == word[i]:
		word[i] = "peach"
	elif "peach" == word[i]:
		word[i] = "apple"
	else: pass

for i in xrange(len(word) - 1): print word[i],
print word[len(word) - 1] + "."

Submission status: Wrong Answer

Solution code:
word = raw_input()
word = word[:-1].split()
for i in xrange(len(word)):
	if "apple" == word[i]:
		word[i] = "peach"
	elif "peach" == word[i]:
		word[i] = "apple"
	else: pass

for i in xrange(len(word) - 1): print word[i],
print word[len(word) - 1] + "."

Submission status: Wrong Answer

Solution code:
word = raw_input()
word = word[:-1].split()
for i in xrange(len(word)):
	if word[i] == "apple":
		word[i] = "peach"
	elif word[i] == "peach":
		word[i] = "apple"

for i in xrange(len(word) - 1): print word[i],
print word[len(word) - 1] + "."

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
en=raw_input().split()
ans=[]
for sen in en:
    sen.replace("apple","?")
    sen.replace("peach","apple")
    sen.replace("?","peach")
    ans.append(sen)
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
en=raw_input().split()
ans=[]
for sen in en:
    sen=sen.replace("apple","?")
    sen=sen.replace("peach","apple")
    sen=sen.replace("?","peach")
    ans.append(sen)
print(" ".join(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = list(input().split())

for i in range(len(l)):
    if 'apple' in l[i]:
        l[i] = 'peach'
    elif 'peach' in l[i]:
        l[i] = 'apple'

    print(l[i], end="")
    if i != len(l)-1: print(" ",end="")

print(".")

Submission status: Wrong Answer

Solution code:
l = list(input().split())

for i in range(len(l)):
    if 'apple' == l[i]:
        l[i] = 'peach'
    elif 'peach' == l[i]:
        l[i] = 'apple'
    elif 'apple.' == l[i]:
        l[i] = 'peach.'
    elif 'peach.' == l[i]:
        l[i] = 'apple.'

    print(l[i],end="")
    if i != len(l)-1: print(" ",end="");

print("")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
sentence = input().split()


def converter(s):
    if 'apple' in s:
        if '.' in s:
            s = 'peach.'
        else:
            s = 'peach'
    elif 'peach' in s:
        if '.' in s:
            s = 'apple.'
        else:
            s = 'apple'
    return s

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

Submission status: Wrong Answer

Solution code:
sentence = input().split()


def converter(s):
    if 'apple' in s:
        if '.' in s:
            s = 'peach.'
        else:
            s = 'peach'
    elif 'peach' in s:
        if '.' in s:
            s = 'apple.'
        else:
            s = 'apple'
    return s

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

Submission status: Wrong Answer

Solution code:
Sent = input()
Sent = Sent.replace('apple', 'P')
Sent = Sent.replace('peach', 'A')
Sent = Sent.replace('A', 'apple')
Sent = Sent.replace('P', 'peach')
print(Sent)

Submission status: Wrong Answer

Solution code:
s=input().rstrip(".").split()
v=""
for i in s:
    if i=="peach":
        v+="apple "
    elif i=="apple":
        v+="peach "
    else:
        v+=i+" "
print(v.rstrip()+".")

Submission status: Wrong Answer

Solution code:
s=input().rstrip(".").split()
v=[]
for i in s:
    if i=="peach":
        v.append("apple")
    elif i=="apple":
        v.append("peach")
    else:
        v.append(i)
print(" ".join(v)+".")

Submission status: Wrong Answer

Solution code:
s = list(input().split())
tmp = list(s[-1])
tmp.pop()
s[-1] = ''.join(tmp)
for i in range(len(s)):
    if s[i] == 'apple':
        s[i] = 'peach'
    elif s[i] == 'peach':
        s[i] = 'apple'

for i in range(len(s)-1):
    print(s[i],end = ' ')
print(s[-1],end = '.\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0050
Apple and Peach
"""
import sys


def main(args):
    for line in sys.stdin:
        input_texts = line.strip().split(' ')

    result_words = []
    for w in input_texts:
        if w.startswith('apple'):
            result_words.append(w.replace('apple', 'peach'))
        elif w.startswith('peach'):
            result_words.append(w.replace('peach', 'apple'))
        else:
            result_words.append(w)
    print('{0}'.format(' '.join(result_words)))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0050
Apple and Peach
"""
import sys


def main(args):
    input_texts = []
    for line in sys.stdin:
        input_texts = line.strip().split(' ')

    result_words = []
    for w in input_texts:
        if w.startswith('apple'):
            result_words.append(w.replace('apple', 'peach'))
        elif w.startswith('peach'):
            result_words.append(w.replace('peach', 'apple'))
        elif w.startswith('Apple'):
            result_words.append(w.replace('Apple', 'Peach'))
        elif w.startswith('Peach'):
            result_words.append(w.replace('Peach', 'Apple'))
        else:
            result_words.append(w)
    print('{0}'.format(' '.join(result_words)), end='')


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
from collections import deque

result = deque()
for _ in input().split():
    if   'apple' in _ : result.append('peach')
    elif 'peach' in _ : result.append('apple')
    else : result.append(_)
print(*result)

Submission status: Wrong Answer

Solution code:
from collections import deque

result = deque()
for _ in input().split():
    if   'apple' in _ : result.append(_.replace('peach', 'apple'))
    elif 'peach' in _ : result.append(_.replace('apple', 'peach'))
    else : result.append(_)
print(*result)

Submission status: Wrong Answer

Solution code:
s = input().split()
for i in range(len(s)):
    if s[i][:5] == "apple":
        s[i] = "peach" + s[i][5:]
    elif s[i][:5] == "peach":
        s[i] = "apple" + s[i][5:]
for i in range(len(s)):
    if i == len(s) - 1:
        print(s[i])
    else:
        print(s[i], end=" ")

Submission status: Wrong Answer

Solution code:
d = {"apple": "peach", "peach": "apple"}
ans = []
for c in input().split():
    try:
        ans.append(d[c])
    except:
        ans.append(c)
print(*ans)

Submission status: Wrong Answer

Solution code:
ans = []
for word in input().split():
    if "apple" in word:
        ans.append(word.replace("apple", "peach"))
    elif "peach" in word:
        ans.append(word.replace("peach", "apple"))
    else:
        ans.append(word)
print(*word)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0050
Apple and Peach
"""
import sys


def main(args):
    # text = 'the cost of one peach is higher than that of one apple.'
    text = input()
    t1 = text.split('apple')
    for i in range(len(t1)):
        t1[i] = t1[i].replace('peach', 'apple')
    t2 = 'peach'.join(t1)

    t3 = t2.split('Apple')
    for i in range(len(t3)):
        t3[i] = t3[i].replace('Peach', 'Apple')
    t4 = 'Peach'.join(t3)
    print(t4)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
import re
out=[]
for w in input().split(" "):
    if re.match("apple",w)!=None:out.append(re.sub("apple","peach",w))
    elif re.match("peach",w)!=None:out.append(re.sub("peach","apple",w))
    else:out.append(w)
print(' '.join(out))

Submission status: Wrong Answer

Solution code:
inp = input()
tmp = inp.replace("apple", "XXX")
print(tmp.replace("XXX", "peach"))

Submission status: Wrong Answer

Solution code:
inp = input()
tmp = inp.replace("apple", "XXX")
tmp = tmp.replace("pearch", "apple")
print(tmp.replace("XXX", "peach"))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()[:-1].split()
for i in range(len(s)):
    if s[i] == "peach":s[i] = "apple"
    elif s[i] == "apple":s[i] = "orange"
s[-1] += "."
print(*s)

Submission status: Wrong Answer

Solution code:
s = input().split()
for i in range(len(s)):
    if "peach" in s[i]:s[i] = "apple" + s[i][5:]
    elif "apple" in s[i]:s[i] = "orange" + s[i][5:]
print(*s)

Submission status: Wrong Answer

Solution code:
import re
s=input()
print(re.sub("peach","apple",s))

Submission status: Wrong Answer

Solution code:
while 1:
	try: st = list(str(input()).split())
	except: break
	for i in range(len(st)):
		if st[i] == "apple": st[i] = "peach"
		elif st[i] == "apple.": st[i] = "peach."
		elif st[i] == "peach": st[i] = "apple"
		elif st[i] == "peach.": st[i] = "peach."
	print(" ".join(st))

Submission status: Wrong Answer

Solution code:
while 1:
	try: st = list(str(input()).split())
	except: break
	for i in range(len(st)):
		if st[i] == "apple": st[i] = "peach"
		elif st[i] == "apple.": st[i] = "peach."
		elif st[i] == "apple.": st[i] = "peach."
		elif st[i] == "peach": st[i] = "apple"
		elif st[i] == "peach.": st[i] = "apple."
	print(" ".join(st))

Submission status: Wrong Answer

Solution code:
while 1:
	try: st = list(str(input()).split())
	except: break
	for i in range(len(st)):
		if st[i] == "apple": st[i] = "peach"
		elif st[i] == "apple.": st[i] = "peach."
		elif st[i] == "apple.": st[i] = "peach."
		elif st[i] == "apple,": st[i] = "peach,"
		elif st[i] == "peach": st[i] = "apple"
		elif st[i] == "peach.": st[i] = "apple."
		elif st[i] == "peach,": st[i] = "apple,"
	print(" ".join(st))

Submission status: Wrong Answer

Solution code:
sent = map(str, raw_input().split(' '))

for i in range(len(sent)):
    if sent[i] == 'apple' :
        sent[i] = 'peach'
    elif sent[i] == 'peach':
        sent[i] = 'apple'


for sen in sent:
    print sen,

Submission status: Wrong Answer

Solution code:


sent = map(str, raw_input().split(' '))

for i in range(len(sent)):
    if sent[i] == 'apple' :
        sent[i] = 'peach'
    elif sent[i] == 'peach':
        sent[i] = 'apple'

    elif sent[i] == 'apple,' :
        sent[i] = 'peach,'
    elif sent[i] == 'peach,':
        sent[i] = 'apple,'

    elif sent[i] == 'apple.' :
        sent[i] = 'peach.'
    elif sent[i] == 'peach.':
        sent[i] = 'apple.'

 



for sen in sent:
    print sen,
    
for sen in sent:
    print len(sen),

Submission status: Wrong Answer

Solution code:


sent = map(str, raw_input().split(' '))

for i in range(len(sent)):
    if sent[i] == 'apple' :
        sent[i] = 'peach'
    elif sent[i] == 'peach':
        sent[i] = 'apple'

    elif sent[i] == 'apple,' :
        sent[i] = 'peach,'
    elif sent[i] == 'peach,':
        sent[i] = 'apple,'

    elif sent[i] == 'apple.' :
        sent[i] = 'peach.'
    elif sent[i] == 'peach.':
        sent[i] = 'apple.'

 



for sen in sent:
    print sen,

Submission status: Wrong Answer

Solution code:


sent = map(str, raw_input().split(' '))

for i in range(len(sent)):
    if sent[i] == 'apple' :
        sent[i] = 'peach'
    elif sent[i] == 'peach':
        sent[i] = 'apple'

    elif sent[i] == 'apple,' :
        sent[i] = 'peach,'
    elif sent[i] == 'peach,':
        sent[i] = 'apple,'

    elif sent[i] == 'apple.' :
        sent[i] = 'peach.'
    elif sent[i] == 'peach.':
        sent[i] = 'apple.'

    elif sent[i] == 'apple!' :
        sent[i] = 'peach!'
    elif sent[i] == 'peach!':
        sent[i] = 'apple!'

    elif sent[i] == 'apple?' :
        sent[i] = 'peach?'
    elif sent[i] == 'peach?':
        sent[i] = 'apple?'

 



for sen in sent:
    print sen,

Submission status: Wrong Answer

Solution code:
s=raw_input()
for i in range(len(s)-5):
    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: Wrong Answer

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

Submission status: Wrong Answer

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 w.startswith('apple'):
            L.append(w.replace('apple', 'peach'))
        elif w.startswith('peach'):
            L.append(w.replace('peach', 'apple'))
        else:
            L.append(w)
    print(*L)

Submission status: Wrong Answer

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 any(w == ('apple' + c) for c in ('', ',', '.')):
            L.append(w.replace('apple', 'peach'))
        elif any(w == ('peach' + c) for c in ('', ',', '.')):
            L.append(w.replace('peach', 'apple'))
        else:
            L.append(w)
    print(*L)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
msg = raw_input()
for i in range(len(msg)-5):
    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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=raw_input()
a = a[0:len(a)-1].split()
print a
b = 0
for i in a:
    if 'apple' in i:
        a[b] = "peach"
        b+=1
        continue

    if 'peach' in i:
        a[b] = "apple"
        b+=1
        continue
    b+=1

print " ".join(a)+"."

Submission status: Wrong Answer

Solution code:
a=raw_input().split()
b = 0
for i in a:
    if 'apple' in i:
        a[b].replace("apple", "peach")
        b+=1
        continue

    if 'peach' in i:
        a[b].replace("peach", "apple")
        b+=1
        continue
    b+=1

print " ".join(a)

Submission status: Accepted

Solution code:
import string
s = raw_input()
print s.replace("apple", "%").replace("peach","apple").replace("%","peach")

Submission status: Accepted

Solution code:
w=str(input())
for i in range(len(w)):
    if i>len(w):break
    if w[i]=="a" and w[i+1]=="p" and w[i+2]=="p" and w[i+3]=="l" and w[i+4]=="e":
        w=w[:i]+"peach"+w[i+5:]
        continue
    if w[i]=="p" and w[i+1]=="e" and w[i+2]=="a" and w[i+3]=="c" and w[i+4]=="h":
        w=w[:i]+"apple"+w[i+5:]
print(w)

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','temptemptemp')).replace('peach','apple')).replace('temptemptemp','peach')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

sentences = f.readline().split()

for i in range(len(sentences)):
    if 'apple' in sentences[i]:
        sentences[i] = sentences[i].replace('apple', 'peach')
    elif 'peach' in sentences[i]:
        sentences[i] = sentences[i].replace('peach', 'apple')
print(' '.join(sentences))

Submission status: Accepted

Solution code:
ls =raw_input().split()
for k in range(len(ls)):
    ls[k] = ls[k].replace('apple','Z').replace('peach','apple').replace('Z','peach')
print ' '.join(map(str,ls))

Submission status: Accepted

Solution code:
s = raw_input()
s = s.replace("peach", "tttt")
s = s.replace("apple", "peach")
s = s.replace("tttt", "apple")

print s

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    try:
        sentence = raw_input().split()
        for index, string in enumerate(sentence):
            if 'peach' in string:
                s = string.find('peach')
                sentence[index] = string[:s] + 'apple' + string[s+5:]
            elif 'apple' in string:
                s = string.find('apple')
                sentence[index] = string[:s] + 'peach' + string[s+5:]
        else:
            print ' '.join(sentence)
    except EOFError:
        break

Submission status: Accepted

Solution code:
l=map(str,raw_input().split())
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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string=input()
string1=string.replace('peach','tmp')
string2=string1.replace('apple','peach')
string3=string2.replace('tmp','apple')
print(string3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

text = map(str, raw_input().split())
for i in range(len(text)):
    if "apple" in text[i]:
        text[i] = text[i].replace("apple", "peach")
    elif "peach" in text[i]:
        text[i] = text[i].replace("peach", "apple")
print " ".join(map(str, text))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cs = list(input())
ap = [list('apple'), list('peach')]
for i in range(len(cs) - 4):
    if cs[i: i + 5] in ap:
        cs[i: i + 5] = ap[1 - ap.index(cs[i: i + 5])]
print(''.join(cs))

Submission status: Accepted

Solution code:
l1 = [i for i in input().rstrip()]
l2 = ""
l3 = ""

for s in l1:
  l2 += s
  if "apple" in l2:
    l2 = l2.replace("apple","peach")
    l3 += l2
    l2 = ""
  elif "peach" in l2:
    l2 = l2.replace("peach","apple")
    l3 += l2
    l2 = ""
l3 += l2
print(l3)

Submission status: Accepted

Solution code:
Sent = input()
Sent = Sent.replace('apple', 'P')
Sent = Sent.replace('peach', 'apple')
Sent = Sent.replace('P', 'peach')
print(Sent)

Submission status: Accepted

Solution code:
ans = []
for s in input().split():
    if "apple" in s:
        ans.append(s.replace("apple", "peach"))
    elif "peach" in s:
        ans.append(s.replace("peach", "apple"))
    else:
        ans.append(s)
print(" ".join(ans))

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','tmp')
s = s.replace('peach','apple')
print(s.replace('tmp','peach'))

Submission status: Accepted

Solution code:
import re
s = input().strip()
kw = 'xxxx'
while kw in s:
    kw = kw+'x'
t = re.sub(r'apple',kw,s)
u = re.sub(r'peach','apple',t)
v = re.sub(kw,'peach',u)
print(v)

Submission status: Accepted

Solution code:
while True:
    try:
        S = input()
    except EOFError:
        break
    for i in range(len(S) - 5 + 1):
        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:
instr = input()
for i in range(len(instr)-4):
    if instr[i:i+5] == "apple": instr = instr[:i]+"peach"+instr[i+5:]
    elif instr[i:i+5] == "peach":instr = instr[:i]+"apple"+instr[i+5:]
print(instr)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os
import math
import itertools

d = {}
d['A'] = 0
d['B'] = 0
d['AB'] = 0
d['O'] = 0

s = input().strip()

apple_key = 'a)@#%^(@#)$&@'
peach_key = 'p#*$^(#$&#)(*'

s = s.replace('apple', apple_key)
s = s.replace('peach', peach_key)

s = s.replace(apple_key, 'peach')
s = s.replace(peach_key, 'apple')

print(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

s = input().strip()

apple_key = 'a)@#%^(@#)$&@'
peach_key = 'p#*$^(#$&#)(*'

s = s.replace('apple', apple_key)
s = s.replace('peach', peach_key)

s = s.replace(apple_key, 'peach')
s = s.replace(peach_key, 'apple')

print(s)

Submission status: Accepted

Solution code:
from collections import deque

result = deque()
for _ in input().split():
    if 'apple' in _ : 
        if _ == 'apple' : result.append('peach') 
        else : result.append(_.replace('apple', 'peach'))
    elif 'peach' in _ : 
        if _ == 'peach' : result.append('apple')
        else : result.append(_.replace('peach', 'apple'))
    else : result.append(_)
print(*result)

Submission status: Accepted

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(w)
print(' '.join(ss))

Submission status: Accepted

Solution code:
string = input()
temp = string.replace("apple","temp")
peach = temp.replace("peach","apple")
dest = peach.replace("temp","peach")
print(dest)

Submission status: Accepted

Solution code:
# Aizu Problem 0050: Apple and Peach
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

dummy = "fadlsjkfhadslkjhfadskljghadsiuowzhgalsjdhflksjdhfasdjsadklfhasjdkhfalsdfhsadljkhfajdkshfadlfshadjkuihzuizt9285692843756239847ztsadhgsjaklg"

for line in sys.stdin:
    print(line.strip().replace("apple", dummy).replace("peach", "apple").replace(dummy, "peach"))

Submission status: Accepted

Solution code:
ans = []
for word in input().split():
    if "apple" in word:
        ans.append(word.replace("apple", "peach"))
    elif "peach" in word:
        ans.append(word.replace("peach", "apple"))
    else:
        ans.append(word)
print(*ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0050
Apple and Peach
"""
import sys


def main(args):
    text = input()
    non_exist = 'qwertyuiop'
    while non_exist in text:
        non_exist += '@'
    text = text.replace('apple', non_exist)
    text = text.replace('peach', 'apple')
    text = text.replace(non_exist, 'peach')
    print(text)

if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import re
out=[]
for w in input().split(" "):
    if re.search("apple",w)!=None:out.append(re.sub("apple","peach",w))
    elif re.search("peach",w)!=None:out.append(re.sub("peach","apple",w))
    else:out.append(w)
print(' '.join(out))

Submission status: Accepted

Solution code:
input_line1 = input()

result = input_line1.replace('apple', 'xxxxxxxx')
result = result.replace('peach', 'apple')
result = result.replace('xxxxxxxx', 'peach')
    
print(result)

Submission status: Accepted

Solution code:
def change_apple_peach(sentence):
    sentence = sentence.replace('apple','aaa')
    sentence = sentence.replace('peach','ppp')
    sentence = sentence.replace('aaa','peach')
    sentence = sentence.replace('ppp','apple')
    print(sentence)

def main():
    str = input()
    change_apple_peach(str)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def change_apple_peach(sentence):
    sentence = sentence.replace('apple','aaa')
    sentence = sentence.replace('peach','apple')
    sentence = sentence.replace('aaa','peach')
    print(sentence)

def main():
    str = input()
    change_apple_peach(str)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
inp = input()
tmp = inp.replace("apple", "XXX")
tmp = tmp.replace("peach", "apple")
print(tmp.replace("XXX", "peach"))

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:
ans = []
for s in input().split():
    if "apple" in s:
        ans.append(s.replace("apple", "peach"))
    elif "peach" in s:
        ans.append(s.replace("peach", "apple"))
    else:
        ans.append(s)
print(" ".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"


def main():
    S = input()
    print(S.replace("apple", "あ").replace("peach", "apple").replace("あ", "peach"))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#入力して単語に分けてリスト化
s=input().split()
#print(s)

ss=[]
for w in s:
    a=w.find("apple")
    p=w.find("peach")
    #find関数は見つからなかったら-1を返す
    if a!=-1:
        w=w.replace("apple","peach")
    elif p!=-1:
        w=w.replace("peach","apple")
    ss.append(w)
print(" ".join(ss))

Submission status: Accepted

Solution code:
s = input().split()
for i in range(len(s)):
    if "peach" in s[i]:n = s[i].index("peach");s[i] = s[i][:n] + "apple" + s[i][n + 5:]
    elif "apple" in s[i]:n = s[i].index("apple");s[i] = s[i][:n] + "peach" + s[i][n + 5:]
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:
import re
s=input()
s=re.sub("peach","!!!!!",s)
s=re.sub("apple","peach",s)
s=re.sub("!!!!!","apple",s)
print(s)

Submission status: Accepted

Solution code:
# AOJ 0050 Apple and Peach
# Python3 2018.6.17 bal4u

s = input()
s = s.replace('apple', '_____')
s = s.replace('peach', 'apple')
print(s.replace('_____', 'peach'))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
print(re.sub(r"(apple|peach)", lambda m: ["apple","peach"][m.group(0)=="apple"], input()))