/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 100 + 100;
const ll inf = 1e18;

//Main CODE :/\

int mp[maxn] , num[maxn];
int main() {
    _Sync
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
        mp[s[i] - 'a']++;
    if (s.size() < 26){
        cout << s;
        for (int i = 0; i < 26; i++)
            if (!mp[i])
                return cout << char(i + 'a') << "\n" , 0;
    }
    if (s == "zyxwvutsrqponmlkjihgfedcba")
        return cout << "-1\n" , 0;
    for (int i = 0; i <= 25; i++){
        num[s[25 - i] - 'a'] = 1;
        if (s[24 - i] < s[25 - i])
            for (int j = 0; j <= 26; j++)
                if (num[j] == 1 && j > s[24 - i] - 'a')
                    return cout << s.substr(0, 24 - i) << char('a' + j) << "\n" , 0;
    }
    return 0;
}
//The_End
//Game Over :D
