#include<iostream>
#include<string>
using namespace std;

int main() {
    bool alpha[26] = {false};
    string tasai_na_tango;
    cin >> tasai_na_tango;
    for (int i=0; i<tasai_na_tango.size(); i++) {
        if (tasai_na_tango[i] == 'a') alpha[0] = true;
        else if (tasai_na_tango[i] == 'b') alpha[1] = true;
        else if (tasai_na_tango[i] == 'c') alpha[2] = true;
        else if (tasai_na_tango[i] == 'd') alpha[3] = true;
        else if (tasai_na_tango[i] == 'e') alpha[4] = true;
        else if (tasai_na_tango[i] == 'f') alpha[5] = true;
        else if (tasai_na_tango[i] == 'g') alpha[6] = true;
        else if (tasai_na_tango[i] == 'h') alpha[7] = true;
        else if (tasai_na_tango[i] == 'i') alpha[8] = true;
        else if (tasai_na_tango[i] == 'j') alpha[9] = true;
        else if (tasai_na_tango[i] == 'k') alpha[10] = true;
        else if (tasai_na_tango[i] == 'l') alpha[11] = true;
        else if (tasai_na_tango[i] == 'm') alpha[12] = true;
        else if (tasai_na_tango[i] == 'n') alpha[13] = true;
        else if (tasai_na_tango[i] == 'o') alpha[14] = true;
        else if (tasai_na_tango[i] == 'p') alpha[15] = true;
        else if (tasai_na_tango[i] == 'q') alpha[16] = true;
        else if (tasai_na_tango[i] == 'r') alpha[17] = true;
        else if (tasai_na_tango[i] == 's') alpha[18] = true;
        else if (tasai_na_tango[i] == 't') alpha[19] = true;
        else if (tasai_na_tango[i] == 'u') alpha[20] = true;
        else if (tasai_na_tango[i] == 'v') alpha[21] = true;
        else if (tasai_na_tango[i] == 'w') alpha[22] = true;
        else if (tasai_na_tango[i] == 'x') alpha[23] = true;
        else if (tasai_na_tango[i] == 'y') alpha[24] = true;
        else alpha[25] = true;
    }
    if (tasai_na_tango.size() == 26) {
        int i=25, j;
        while (i >= 0) {
            if (tasai_na_tango[i] == 'a') {j = 0; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'b') {j = 1; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'c') {j = 2; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'd') {j = 3; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'e') {j = 4; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'f') {j = 5; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'g') {j = 6; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'h') {j = 7; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'i') {j = 8; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'j') {j = 9; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'k') {j = 10; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'l') {j = 11; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'm') {j = 12; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'n') {j = 13; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'o') {j = 14; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'p') {j = 15; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'q') {j = 16; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'r') {j = 17; alpha[j] = false;}
            else if (tasai_na_tango[i] == 's') {j = 18; alpha[j] = false;}
            else if (tasai_na_tango[i] == 't') {j = 19; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'u') {j = 20; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'v') {j = 21; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'w') {j = 22; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'x') {j = 23; alpha[j] = false;}
            else if (tasai_na_tango[i] == 'y') {j = 24; alpha[j] = false;}
            else {j = 25; alpha[j] = false;}
            tasai_na_tango.pop_back();
            for (int k=j+1; k<26; k++) {
                if (alpha[k] != true) {
                    char last_alpha;
                    if (k == 0) last_alpha = 'a';
                    else if (k == 1) last_alpha = 'b';
                    else if (k == 2) last_alpha = 'c';
                    else if (k == 3) last_alpha = 'd';
                    else if (k == 4) last_alpha = 'e';
                    else if (k == 5) last_alpha = 'f';
                    else if (k == 6) last_alpha = 'g';
                    else if (k == 7) last_alpha = 'h';
                    else if (k == 8) last_alpha = 'i';
                    else if (k == 9) last_alpha = 'j';
                    else if (k == 10) last_alpha = 'k';
                    else if (k == 11) last_alpha = 'l';
                    else if (k == 12) last_alpha = 'm';
                    else if (k == 13) last_alpha = 'n';
                    else if (k == 14) last_alpha = 'o';
                    else if (k == 15) last_alpha = 'p';
                    else if (k == 16) last_alpha = 'q';
                    else if (k == 17) last_alpha = 'r';
                    else if (k == 18) last_alpha = 's';
                    else if (k == 19) last_alpha = 't';
                    else if (k == 20) last_alpha = 'u';
                    else if (k == 21) last_alpha = 'v';
                    else if (k == 22) last_alpha = 'w';
                    else if (k == 23) last_alpha = 'x';
                    else if (k == 24) last_alpha = 'y';
                    else last_alpha = 'z';
                    cout << tasai_na_tango + last_alpha << endl;
                    return 0;
                }
            }
            i--;
        }
        cout << "-1" << endl;
        return 0;
    }
    else {
        char last_alpha;
        for (int i=0; i<26; i++) {
            if (! alpha[i]) {
                if (i == 0) last_alpha = 'a';
                else if (i == 1) last_alpha = 'b';
                else if (i == 2) last_alpha = 'c';
                else if (i == 3) last_alpha = 'd';
                else if (i == 4) last_alpha = 'e';
                else if (i == 5) last_alpha = 'f';
                else if (i == 6) last_alpha = 'g';
                else if (i == 7) last_alpha = 'h';
                else if (i == 8) last_alpha = 'i';
                else if (i == 9) last_alpha = 'j';
                else if (i == 10) last_alpha = 'k';
                else if (i == 11) last_alpha = 'l';
                else if (i == 12) last_alpha = 'm';
                else if (i == 13) last_alpha = 'n';
                else if (i == 14) last_alpha = 'o';
                else if (i == 15) last_alpha = 'p';
                else if (i == 16) last_alpha = 'q';
                else if (i == 17) last_alpha = 'r';
                else if (i == 18) last_alpha = 's';
                else if (i == 19) last_alpha = 't';
                else if (i == 20) last_alpha = 'u';
                else if (i == 21) last_alpha = 'v';
                else if (i == 22) last_alpha = 'w';
                else if (i == 23) last_alpha = 'x';
                else if (i == 24) last_alpha = 'y';
                else last_alpha = 'z';
                break;
            }
        }
        cout << tasai_na_tango + last_alpha << endl;
    }
}

Measured memory_bytes: 256