s = input()
li = []
for each in s:
if each.isalpha() and each.isupper() and each not in li:
li.append(each)
if not li:
print('Not Found')
else:
print(''.join(li))
s = input()
li = []
for each in s:
if each.isalpha() and each.isupper() and each not in li:
li.append(each)
if not li:
print('Not Found')
else:
print(''.join(li))