import java.util.Scanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) throws IOException {
        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str=reader.readLine())!=null){
            findfirstChar(str);
        }
    }
    public static void findfirstChar(String str) {
        char[] arr = str.toCharArray();
        int[] count = new int[128];
        for (int i = 0; i < arr.length; i++) {
            count[arr[i]]++;
        }
        boolean ret = false;
        for (int i = 0; i < arr.length; i++) {
            if (count[arr[i]] == 1) {
                System.out.println(arr[i]);
                ret = true;
                break;
            }
        }
        if (!ret) {
            System.out.println(-1);
        }
    }
}