using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace Contest
{
    class Scanner
    {
        private string[] line = new string[0];
        private int index = 0;
        public string Next()
        {
            if (line.Length <= index)
            {
                line = Console.ReadLine().Split(' ');
                index = 0;
            }
            var res = line[index];
            index++;
            return res;
        }
        public int NextInt()
        {
            return int.Parse(Next());
        }
        public long NextLong()
        {
            return long.Parse(Next());
        }
        public string[] Array()
        {
            line = Console.ReadLine().Split(' ');
            index = line.Length;
            return line;
        }
        public int[] IntArray()
        {
            return Array().Select(int.Parse).ToArray();
        }
        public long[] LongArray()
        {
            return Array().Select(long.Parse).ToArray();
        }
    }

    static class Algorithm
    {
        #region NextPermutation
        public static bool NextPermutation<T>(T[] array, int start, int length)
        {
            return NextPermutation(array, start, length, Comparer<T>.Default);
        }
        public static bool NextPermutation<T>(T[] array, int start, int length, IComparer<T> comparer)
        {
            return NextPermutation(array, start, length, comparer.Compare);
        }
        public static bool NextPermutation<T>(T[] array, int start, int length, Comparison<T> compare)
        {
            int end = start + length - 1;

            if (end <= start) return false;

            int last = end;
            while (true)
            {
                int pos = last--;
                if (compare(array[last], array[pos]) < 0)
                {
                    int i;
                    for (i = end + 1; compare(array[last], array[--i]) >= 0;) ;
                    T tmp = array[last]; array[last] = array[i]; array[i] = tmp;
                    Array.Reverse(array, pos, end - pos + 1);
                    return true;
                }
                if (last == start)  // 最後の順列
                {
                    Array.Reverse(array, start, end - start);
                    return false;
                }
            }
            throw new Exception("NextPermutation: Fatal error");
        }
        public static bool NextPermutation<T>(T[] array, IComparer<T> comparer)
        {
            return NextPermutation(array, 0, array.Length, comparer);
        }
        public static bool NextPermutation<T>(T[] array, Comparison<T> compare)
        {
            return NextPermutation(array, 0, array.Length, compare);
        }
        public static bool NextPermutation<T>(T[] array)
        {
            return NextPermutation(array, 0, array.Length);
        }
        #endregion
    }

    class Program
    {
        private string S;
        private void Scan()
        {

            var sc = new Scanner();
            S = sc.Next();
        }

        public void Solve()
        {
            Scan();
            if (S.Length == 26)
            {
                var ar = S.ToArray();
                if (Algorithm.NextPermutation(ar))
                {
                    for (int i = 0; i < 26; i++)
                    {
                        Console.Write(ar[i]);
                        if (S[i] != ar[i])
                        {
                            break;
                        }
                    }
                }
                else
                {
                    Console.WriteLine(-1);
                }
                return;
            }

            var b = new bool[256];
            foreach (var c in S)
            {
                b[c] = true;
            }

            for (char c = 'a'; c <= 'z'; c++)
            {
                if (!b[c])
                {
                    Console.WriteLine(S + c.ToString());
                    return;
                }
            }
        }

        static void Main(string[] args)
        {
            new Program().Solve();
        }
    }
}

Measured memory_bytes: 13268