import std.stdio;
import std.string;
import std.conv;
import std.algorithm;

void main()
{
	auto S = split(readln())[0];
	//if (S == "zyxwvutsrqponmlkjihgfedcba") { writeln("-1"); return; }
	
	if (S.length < 26) { writeln(solve1(S)); }
	else { writeln(solve2(S)); }
}

string solve1(string S) {
	
	bool[26] list;
	foreach (c; S) list[c-'a'] = true;
	
	foreach (i, f; list) {
		if (!f) { return S ~ ( to!char('a'+i) ); }
	}
	
	return "a";
	
}

string solve2(string S) {
	int index = 25;
	while (index >= 1) {
		if (S[index] == 'z') { --index; continue; }
		foreach ( c;  S[index] + 1 .. 'z'+1 ) {
			if (S[0..index].find(to!char(c)).length == 0) return S[0..index] ~ to!char(c);
		}
		
		--index;
	}
	return "-1";
}
