#include <iostream>
#include <vector>
using namespace std;

int main() {
    string str;
    vector<char> vec(1001, 0);
    while (cin >> str) { 
        for (auto i:str){
            ++vec[i];
        }
        int flag;
        for (auto i:str){
            if (vec[i] == 1){
                cout << i << endl;
                flag = 1;
                break;
            }
            else {
                flag = -1;
            }
        }
        if (flag == -1)
            cout << flag << endl; 
    }
    return 0;
}