while True:
try:
myStr=list(input())
mySet = set(myStr) # 字符串元素种类
dic={}
for e in mySet:
dic[e]=0
for e in mySet:
for i in range(len(myStr)):
if e==myStr[i]:
dic[e]+=1
for j in range(len(myStr)):
if j<=len(myStr)-1 and dic[myStr[j]]==1:
print(myStr[j])
break
elif j==len(myStr)-1:
print('-1')
except:
break