#include <bits/stdc++.h>
using namespace std;
bool a[26];
int main()
{
	string s;
	cin>>s;
	int i;
	for(int i=0;i<26;i++)a[i] = false;
	for (i = 0; i < s.length(); i++)
	{
		a[s[i] - 'a'] = true;
	}
	for(i=0;i<26;i++)
	{
		if(a[i] == false)
			break;
	}
	if(i < 26)
		cout<<s << char(i+'a')<<endl;
	else
		{
			string t = s;
			bool val = next_permutation(s.begin(),s.end());			
				if(val == false)
					cout<<-1;
				else {
					for(i=0;i<s.length();i++)
					{
						if(s[i]!=t[i])
						{
							cout<<s[i];
							break;
						}
						cout<<s[i];
					}
				}

		}
}