#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
bool a[26];
int main(){
	string s;
	cin>>s;
	int n=s.size();
	r(i,n)a[s[i]-'a']++;
	if(n<26){
		r(i,26)if(!a[i]){
			s+=(i+'a');
			break;
		}
		cout<<s<<endl;
	}
	else if(s=="zyxwvutsrqponmlkjihgfedcba")cout<<-1<<endl;
	else{
		string t=s,ans;
		next_permutation(s.begin(),s.end());
		r(i,n){
			ans+=s[i];
			if(t[i]!=s[i])break;
		}
		cout<<ans<<endl;
	}
}