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


void main() {
    auto s = readln.chomp.to!(char[]);

    auto ans = repeat('z', 100).to!(char[]);
    auto ex = new bool[](26);

    if (s[0] < 'z') {
        ans = [(s[0] + 1).to!char];
    }

    foreach (int j, ch ; s) {
        ex[ch - 'a'] = 1;

        char[] tmp;

        if (j < s.length.to!int - 1) {
            foreach (i ; s[j + 1] - 'a' + 1 .. 26) {
                if (!ex[i]) {
                    tmp = s[0 .. j + 1] ~ ('a' + i).to!char;
                    break;
                }
            }
        }
        else {
            foreach (i ; 0 .. 26) {
                if (!ex[i]) {
                    tmp = s[0 .. j + 1] ~ ('a' + i).to!char;
                    break;
                }
            }
        }

        debug {
            writeln(tmp);
        }

        if (tmp && ans > tmp && s < tmp) {
            ans = tmp;
        }
    }

    if (ans.length > 26) {
        writeln(-1);
        return;
    }

    writeln(ans);
}





void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
