while True:
    try:
        in_str = input()
        res = []
        flag = False
        for x in in_str:
            if in_str.count(x) == 1:
                res.append(x)
                flag = True
        if flag == False:
            print(-1)
        else:
            print(res[0])
    except:
        pass




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