while True:
    try:
        s = input().strip()
        dic = {}
        for x in set(s):
            dic[x] = s.count(x)
        # print(dic)
        lst = []
        for i in s:
            if dic[i] == 1:
                lst.append(i)
        if lst:
            print(lst[0])
        else:
            print("-1")

    except:
        break