paragraph,banned = input().split('|')
paragraph = paragraph.lower().split(' ')
banned = banned.split(',')
dict ={}
for i in paragraph:
    dict[i] = dict.get(i,0)+1

dict = sorted(dict.items(), key = lambda x : x[1], reverse=True)

for item in dict:
    if(item[0] not in banned):
        print(item[0])
        break


36b73f8978861afa5bfaa99918455771a48b05af
<mask token>

<mask token>
for i in paragraph:
    dict[i] = dict.get(i, 0) + 1
<mask token>
for item in dict:
    if item[0] not in banned:
        print(item[0])
        break

paragraph, banned = input().split('|')
paragraph = paragraph.lower().split(' ')
banned = banned.split(',')
dict = {}
for i in paragraph:
    dict[i] = dict.get(i, 0) + 1
dict = sorted(dict.items(), key=lambda x: x[1], reverse=True)
for item in dict:
    if item[0] not in banned:
        print(item[0])
        break

paragraph,banned = input().split('|')
paragraph = paragraph.lower().split(' ')
banned = banned.split(',')
dict ={}
for i in paragraph:
    dict[i] = dict.get(i,0)+1

dict = sorted(dict.items(), key = lambda x : x[1], reverse=True)

for item in dict:
    if(item[0] not in banned):
        print(item[0])
        break

