while True:
    try:
        s = input()
        res = ''
        for c in s:
            if s.count(c) == 1:
                res = c
                break
        if len(res) > 0:
            print(res)
        else:
            print('-1')
    except:
        break