#include <bits/stdc++.h>
using namespace std;
bool occ[26];

int main() {
	string s;
	cin>>s;
	for (int i=0; i<s.length(); i++) occ[s[i]-'a']=true;
	bool found=false;
	for (int i=s.length()-1; i>=0; i--) {
		for (int j=(i==s.length()-1) ? 0 : s[i+1]-'a'+1; j<26; j++) {
			if (!occ[j]) {
				cout<<s.substr(0,i+1)<<char(j+'a')<<endl;
				found=true;
				break;
			}
		}
		if (found) break;
		occ[s[i]-'a']=false;
	}
	if (found) return 0;
	for (int j= s[0]-'a'+1; j<26; j++) {
			if (!occ[j]) {
				cout<<char(j+'a')<<endl;
				found=true;
				break;
			}
		}
	if (!found) cout<<-1<<endl;
}
