while True:
try:
#获取输入字符串
x1 = input()
#定义标签
flag = 0
d = {}
for word in x1:
if word not in d:
d[word] = 1
else:
d[word] += 1
list1 = list(d.values())
if 1 not in list1:
flag = 1
if flag == 1:
print(-1)
break
for k,v in enumerate(x1):
if v not in x1[0:k] and v not in x1[k+1:]:
print(v)
break
except:
break