x=list(input()) if len(set(x))==1: exit(print(-1)) x.sort() for i in range(len(x)-1): if [i]==x[i+1]: continue if i+1