#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
int pos1, pos2, count = 0;
for (int i = 0; i < str.size(); ++i) {
pos1 = str.find(str[i]);
pos2 = str.rfind(str[i]);
if(pos1 != pos2){
count++;
continue;
}
break;
}
if (count == str.size()) {
cout << "-1" << endl;
}
else{
cout << str[pos1] << endl;
}
return 0;
}
// 64 位输出请用 printf("%lld")