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

bool used[26];

int main(){
	string s;
	cin >> s;
	if(s.size() < 26){
		for(int i = 0; i < s.size(); i++){
			used[s[i]-'a'] = true;
		}
		for(int i = 0; i < 26; i++){
			if(!used[i]) {
				s += (char)(i+'a');
				cout << s << endl;
				return 0;
			}
		}
	} else {
		if(s == "zyxwvutsrqponmlkjihgfedcba"){
			cout << -1 << endl;
			return 0;
		}
		string new_string = s;
		next_permutation(new_string.begin(),new_string.end());
		for(int i = 0; i < s.size(); i++){
			cout << new_string[i];
			if(new_string[i] != s[i])
				break;
		}
		cout << endl;
	}
	return 0;
}
