#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <random>
#include <cassert>
#include <numeric>
#define ll long long int
#define LL unsigned long long
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;

ll y[10000005];

int main() {
    string s; cin >> s;
    int n = s.size();

    map<char,int> mp;
    rep(i,n) mp[s[i]]++;

    rep(i,26){
        if(!mp[char (i+97)]){
            cout << s + char(i+97) << endl;
            return 0;
        }
    }
    if(s == "zyxwvutsrqponmlkjihgfedcba") cout << -1 << endl;
    else {
        for(int i = n-1; i >= 1; i--){
            if(s[i-1] < s[i]){
                rep(j,i-1){
                    cout << s[j];
                }
                for(int j = n-1; j>=1;j--){
                    if(s[i-1] < s[j]){
                        cout << s[j];
                        return 0;
                    }
                }
                return 0;
            }
        }
    }
}

/**
*    author:  souzai32
*    created: 05.08.2020 01:20:01
**/

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {

    string s;
    cin >> s;

    int n=s.size();
    vector<bool> alphabet(26);

    if(n==26){
        int i=1;
        while(1){
            if(s.at(n-i)<s.at(n-1-i)) i++;
            else{
                int j=0;
                while(1){
                    if(s.at(n-1-i)<s.at(n-1-j)){
                        s.at(n-1-i)=s.at(n-1-j);
                        break;
                    }
                    else j++;
                }
                
                for(int j=0; j<i; j++) s.pop_back();
                break;
            }

            if(i==26){
                s="-1";
                break;
            }
        }
    }
    else{
        rep(i,n){
            alphabet.at(s.at(i)-'a')=true;
        }

        int i=0;
        char a='a';
        while(1){
            if(alphabet.at(i)) i++;
            else{
                a+=i;
                s.push_back(a);
                break;
            }
        }
    }

    cout << s << endl;
    //cout << s.size() << endl;

    return 0;
}