ls = list(map(int, input().split()))
n = int(input())
if n not in ls:
print('NOT FOUND')
else:
for element in ls.copy():
if (element == n):
ls.remove(element)
print(ls)
ls = list(map(int, input().split()))
n = int(input())
if n not in ls:
print('NOT FOUND')
else:
for element in ls.copy():
if (element == n):
ls.remove(element)
print(ls)