import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

int[26] CS;

void main()
{
    auto S = readln.chomp.to!(char[]);
    foreach (c; S) ++CS[c-97];
    foreach (i, n; CS) {
        if (!n) {
            writeln(S ~ cast(char)(i+97));
            return;
        }
    }
    foreach_reverse (i, c; S) {
        if (c == 'z') continue;
        bool found;
        foreach (d; S[0..i]) {
            if (d == cast(char)(c+1)) {
                found = true;
                break;
            }
        }
        if (!found) {
            writeln(S[0..i] ~ cast(char)(S[i]+1));
            return;
        }
    }
    writeln("-1");
}