#include<iostream>
#include<unordered_map>
using namespace std;
char helper(string &s) {
char c=' ';
unordered_map<char, int> mp;
for(int i=0;i<s.length();i++) {
mp[s[i]]++;
}
for(int i=0;i<s.length();i++) {
if(mp[s[i]]==1) {
c=s[i];
return c;
}
}
return c;
}
int main() {
string s;
while(cin>>s) {
if(helper(s)!=' ') cout<<helper(s)<<endl;
else cout<<-1<<endl;
}
return 0;
}