while True:
try:
a = input()
count = -1
for i in range(len(a)):
if a.count(a[i]) == 1:
count = a[i]
break
print(count)
except:
break
while True:
try:
a = input()
count = -1
for i in range(len(a)):
if a.count(a[i]) == 1:
count = a[i]
break
print(count)
except:
break