import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import std.csv;
import std.regex;
import std.math;
import core.time;
import std.ascii;
import std.digest.sha;

void main()
{
	auto s = readln.chomp;
	enum dist = "abcdefghijklmnopqrstuvwxyz";
	if (s.equal(dist.retro)) {
		writeln = -1;
		return;
	}
	bool[char] done;
	foreach (c; s) {
		done[c] = true;
	}
	string[] arr;
	auto t = s;
	foreach (c; dist) {
		if (c in done) {
			continue;
		}
		t ~= c;
		break;
	}
	if (s != t)
		arr ~= t;
	foreach (i; 0..s.length) {
		done.clear;
		foreach (c; s[0..i]) {
			done[c] = true;
		}
		char c = s[i];
		char e = '.';
		foreach (d; dist) {
			if (d <= c) {
				continue;
			}
			if (d in done) {
				continue;
			}
			e = d;
			break;
		}
		if (e == '.') {
			continue;
		}
		auto u = s[0..i].dup;
		u ~= e;
		arr ~= u.idup;
	}
	// arr.writeln;
	std.algorithm.sort = arr;
	arr.front.writeln;
}
