import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
while(sc.hasNext()) {
String sb= sc.nextLine();
while(sb.length()>0) {
String tem = sb.substring(0,1);
String zz= sb.replaceAll(tem, "");
if((zz.length()+1)==sb.length()) {
System.out.println(tem);
break;
}
sb=zz;
if(sb.length()==0) {
System.out.println(-1);
break;
}
} } }
}