#include <cstdio>
#include <iostream>
#include <bitset>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

#define ALL(obj) (obj).begin(), (obj).end() 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
int main(){
    string s,aa;
    cin >> s;
    if(s == "zyxwvutsrqponmlkjihgfedcba"){
        cout << "-1" << endl;
        return 0;
    }
    if(s.length() <= 25){
        rep(i, 26){
            if((int)s.find((char)i +'a') == -1){
                cout << s;
                printf("%c", (char)i + 'a');
                cout << endl;
                return 0;
            }
        }
    }
    if(s.length() == 26){

        rep(i,s.length()){
            if(s[25-i] > s[24-i]){
                s[24-i] = s[25];
                rep(j,25-i){
                    printf("%c", s[j]);
                }
                cout << endl;
                return 0;
            }
        }
    }
    return 0;
}