#include <bits/stdc++.h>
using namespace std;

string s;
bool a[30];

int main(){
	cin >> s;
	if(s == "zyxwvutsrqponmlkjihgfedcba") printf("-1\n");
	else{
		for(int i=0; i<s.size(); ++i)
			a[s[i]-'a'] = true;
		bool f = false;
		for(int i=0; i<26; ++i)
			if(!a[i]){
				cout << s << (char)('a' + i) << endl;
				f = true;
				break;
			}
		if(!f){
			a[s[s.size()-1]-'a'] = false;
			int t = s.size()-1;
			while(s[t-1] > s[t]){
				--t;
				a[s[t]-'a'] = false;
			}
			char c;
			for(int i=s[t-1]-'a'; i<26; ++i)
				if(!a[i]){
					c = 'a' + i;
					break;
				}
			cout << s.substr(0, t-1) << c <<  endl;
		}
	}
}