#include <iostream>
#include <algorithm>
#include <string>
#include <functional> 
#include <vector>

using namespace std;

int main(){

    string s;
    cin >> s;

    if(s == "zyxwvutsrqponmlkjihgfedcba"){
        cout << "-1";
        return 0;
    }

    if(s.size() <= 25){
        string::size_type index;

        index = s.find("a");
        if(index == string::npos){
            s += "a";
            cout << s;
            return 0;
        }
        index = s.find("b");
        if(index == string::npos){
            s += "b";
            cout << s;
            return 0;
        }
        index = s.find("c");
        if(index == string::npos){
            s += "c";
            cout << s;
            return 0;
        }
        
        index = s.find("d");
        if(index == string::npos){
            s += "d";
            cout << s;
            return 0;
        }
        
        index = s.find("e");
        if(index == string::npos){
            s += "e";
            cout << s;
            return 0;
        }
        
        index = s.find("f");
        if(index == string::npos){
            s += "f";
            cout << s;
            return 0;
        }
        
        index = s.find("g");
        if(index == string::npos){
            s += "g";
            cout << s;
            return 0;
        }
        
        index = s.find("h");
        if(index == string::npos){
            s += "h";
            cout << s;
            return 0;
        }
        
        index = s.find("i");
        if(index == string::npos){
            s += "i";
            cout << s;
            return 0;
        }
        
        index = s.find("j");
        if(index == string::npos){
            s += "j";
            cout << s;
            return 0;
        }
        
        index = s.find("k");
        if(index == string::npos){
            s += "k";
            cout << s;
            return 0;
        }
        
        index = s.find("l");
        if(index == string::npos){
            s += "l";
            cout << s;
            return 0;
        }
        
        index = s.find("m");
        if(index == string::npos){
            s += "m";
            cout << s;
            return 0;
        }
        
        index = s.find("n");
        if(index == string::npos){
            s += "n";
            cout << s;
            return 0;
        }
        
        index = s.find("o");
        if(index == string::npos){
            s += "o";
            cout << s;
            return 0;
        }
        
        index = s.find("p");
        if(index == string::npos){
            s += "p";
            cout << s;
            return 0;
        }
        
        index = s.find("q");
        if(index == string::npos){
            s += "q";
            cout << s;
            return 0;
        }
        
        index = s.find("r");
        if(index == string::npos){
            s += "r";
            cout << s;
            return 0;
        }
        
        index = s.find("s");
        if(index == string::npos){
            s += "s";
            cout << s;
            return 0;
        }
        
        index = s.find("t");
        if(index == string::npos){
            s += "t";
            cout << s;
            return 0;
        }
        
        index = s.find("u");
        if(index == string::npos){
            s += "u";
            cout << s;
            return 0;
        }
        
        index = s.find("v");
        if(index == string::npos){
            s += "v";
            cout << s;
            return 0;
        }
        
        index = s.find("w");
        if(index == string::npos){
            s += "w";
            cout << s;
            return 0;
        }
        
        index = s.find("x");
        if(index == string::npos){
            s += "x";
            cout << s;
            return 0;
        }
        
        index = s.find("y");
        if(index == string::npos){
            s += "y";
            cout << s;
            return 0;
        }

        index = s.find("z");
        if(index == string::npos){
            s += "z";
            cout << s;
            return 0;
        }   
        return 0;
    }

    int ch = -1;
    for(int i = 25;i > 0;i--){
         if(s[i] > s[i-1]){
             ch = i;
             break;
         }
    }

    char che;
    for(int i=ch ;i <= 25; i++){
      	if(i==ch) che = s[i];
        if(s[ch-1] < s[i] && s[i] < che){
            che = s[i];
        }
    }

	for(int i=0;i<ch-1;i++){
    	cout << s[i];
    }
  
  	cout << che;


    return 0;
}

Measured memory_bytes: 256