#include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
while(cin>>s)
{
int count = 0;
for(int i = 0; i < s.size(); i++)
{
count = 0;
for(int j = 0; j < s.size(); j++)
{
if(s[i] == s[j])
count++;
}
if(count == 1)
{
cout<<s[i]<<endl;
break;
}
}
if(count != 1)
{
cout<<-1<<endl;
}
}
return 0;
}