# import sys
while True:
    try:
        s = input().strip()
        f = '-1'
        for c in s:
            if s.count(c) == 1:
                f = c
                break
        print(f)
    except:
#         print(sys.exc_info())
        break