#include <bits/stdc++.h>
using namespace std;
#define    FOR(i,a,n)       for(register int i=a,_=n+1;i^_;++i)
#define    FIR(i,n,a)       for(register int i=n,_=a-1;i^_;--i)
#define    VOR(i,a)         for(register int i=0,n=a.size();i^n;++i)
#define    VIR(i,a)         for(register int i=a.size()-1;~i;--i)
#define    SOR(i,a)         for(register auto i=a.begin();i!=a.end();++i)
#define    all(a)           (a).begin(),(a).end()
#define    vlb(a,n)         (lower_bound(all(a),n)-(a).begin())
#define    vub(a,n)         (upper_bound(all(a),n)-(a).begin())
#define    vlbx(a,n)        a[(lower_bound(all(a),n)-(a).begin())]
#define    vubx(a,n)        a[(upper_bound(all(a),n)-(a).begin())]
#define    mem(a,b)         memset(a,b,sizeof(a))
#define    pw(x)            (1ll<<(x))
#define    sz(x)            (int)x.size()
#define    INT              (1ll<<32)
#define    lowbit(x)        ((x)&(-x))
#pragma    comment(linker, "/STACK:1024000000,1024000000")
#define    lch              p<<1,l,mid
#define    rch              p<<1|1,mid+1,r
#define    ll               p<<1
#define    rr               p<<1|1
#define    queues           priority_queue
#define    pb               push_back
#define    mp(a,b)          make_pair(a,b)
#define    max(...)         _max(__VA_ARGS__)
#define    min(...)         _min(__VA_ARGS__)
#define    lb               lower_bound
#define    ub               upper_bound
#define    ff               first
#define    ss               second
#define    Buff             100000
//__attribute__((optimize("-O2")))
typedef    long long        LL;
typedef    pair<int,int>    PII;
typedef    pair<LL,LL>      PLL;
typedef    vector<char>     VB;
typedef    vector<int>      VI;
typedef    vector<LL>       VL;
typedef    vector<PII>      VII;
typedef    vector<PLL>      VLL;
const int       dx[]={ 0, 1, 0,-1, 0, 1,-1, 1,-1};
const int       dy[]={-1, 0, 1, 0,-1, 1,-1,-1, 1};
const LL        LINF=0xfcfcfcfcfcfcfcfll;
const int       MOD=1000000007;
const int       INF=0x3f3f3f3f;
const double    eps=0.00000001;
const double    ee=2.718281828459;
const double    pi=3.14159265358979323846l;
inline LL pmod(LL x,LL n,LL mod=MOD,LL res=1) { for(; n; x=x*x%mod,n>>=1)if(n&1)res=res*x%mod; return res; }
inline int myrand(int mod) { return ((LL)rand()<<32^(LL)rand()<<16^rand())%mod; }
inline int rand(int a,int b) { return a+myrand(b-a+1); }
template<class T>inline T _max(T a,T b) { return a>b?a:b; }
template<class T>inline T _min(T a,T b) { return a<b?a:b; }
template<class T>inline T _max(T a,T b,T c) { return _max(a,_max(b,c)); }
template<class T>inline T _min(T a,T b,T c) { return _min(a,_min(b,c)); }
template<class T>inline T _max(T a,T b,T c,T d) { return _max(a,_max(b,c,d)); }
template<class T>inline T _min(T a,T b,T c,T d) { return _min(a,_min(b,c,d)); }
inline char gtc() { static char bfi[Buff],*ci=bfi-1,*cl=ci; return ci==cl&&(cl=(ci=bfi-1)+fread(bfi,1,Buff,stdin),ci==cl)?EOF:*++ci; }
void readbit(double &ret,double bit=0.1,char chr=0) { if(chr=gtc(),isdigit(chr))ret+=(chr^'0')*bit,readbit(ret,bit*0.1); }
inline char _read(int &res,char flag=0,int sum=0,char chr=0) { while(chr=gtc(),!(isdigit(chr)||(chr^'-'?0:(chr=gtc(),flag=1)))) if(!~chr) return 0; while(isdigit(chr))sum=(sum+(sum<<2)<<1)+(chr^'0'),chr=gtc(); return (res=flag?-sum:sum,1); }
inline char _read(LL &res,char flag=0,LL sum=0,char chr=0) { while(chr=gtc(),!(isdigit(chr)||(chr^'-'?0:(chr=gtc(),flag=1)))) if(!~chr) return 0; while(isdigit(chr))sum=(sum+(sum<<2)<<1)+(chr^'0'),chr=gtc(); return (res=flag?-sum:sum,1); }
inline char _read(double &ret,char flag=0,LL sum=0,char chr=0) { while(chr=gtc(),!(isdigit(chr)||(chr^'-'?0:(chr=gtc(),flag=1)))) if(!~chr) return 0; while((isdigit(chr)))sum=(sum+(sum<<2)<<1)+(chr^'0'),chr=gtc(); if(ret=sum,!(chr^'.'))readbit(ret); return (ret=flag?-ret:ret,1); }
inline char _read(char &ch,char chr=0) { while(chr=gtc(),!(chr^' ')||!(chr^'\n')||!~chr) if(!~chr) return 0; return ch=chr; }
inline char _read(char *p,char chr=0) { while(chr=gtc(),!(chr^' ')||!(chr^'\n')||!~chr) if(!~chr) return 0; while(chr^'\n'&&~chr)*p++=chr,chr=gtc(); return !(*p=0); }
inline void ptc(char ch=0) { static char bfo[Buff],*co=bfo-1,*coe=co+Buff; if(!ch||(*++co=ch,co==coe))fwrite(bfo,1,co-bfo+1,stdout),co=bfo-1; }
void _out(int x) { if(x<0)ptc('-'),x=-x; if(x>9)_out(x/10); ptc(x%10^'0'); }
void _out(LL x) { if(x<0)ptc('-'),x=-x; if(x>9)_out(x/10); ptc(x%10^'0'); }
inline void _out(double x,int n=6) { if(x<0)ptc('-'),x=-x; _out((LL)x),x-=(LL)x,ptc('.'); while(n--)x*=10; _out(LL(x+0.5)); }
inline void _out(const char ch) { ptc(ch); }
inline void _out(const char *p) { while(*p)ptc(*p++); }
void read() {}
void _out_() {}
template<class T>inline char read(T &head) { return _read(head); }
template<class T>inline char read(T *head) { return _read(head); }
template<class T,class ...U>char read(T &head,U &...tail) { return _read(head),read(tail...); }
template<class T,class ...U>char read(T *head,U &...tail) { return _read(head),read(tail...); }
template<class T,class ...U>char read(T &head,U *...tail) { return _read(head),read(tail...); }
template<class T,class ...U>char read(T *head,U *...tail) { return _read(head),read(tail...); }
template<class T,class ...U>void _out_(T head,U ...tail) { _out(' '),_out(head),_out_(tail...); }
template<class T,class ...U>void out(T head,U ...tail) { _out(head),_out_(tail...),_out('\n'); }
#ifndef ONLINE_JUDGE
void _debug_() {}
void _debug(int x) { _out(x); }
void _debug(LL x) { _out(x); }
void _debug(double x) { _out(x); }
void _debug(const char ch) { _out(ch); }
void _debug(const char *p) { _out(p); }
template<class T,class ...U>void _debug_(T head,U ...tail) { _out(' '),_out(head),_debug_(tail...); }
template<class ...T>void debug(T ...tail) { static int cnt=0; _debug_("#####",++cnt,'|',tail...,'\n'),ptc(); }
#endif
/**_________________________head.end__________________________**/

const int N=30;
char a[N],b[N];
map<char,bool>m[30];

/**_______________________main().begin________________________**/
int main() {
    ios::sync_with_stdio(0),cin.tie(0);
#ifndef ONLINE_JUDGE
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
#endif   ///main code begin......
    cin>>a+1;
    int len=strlen(a+1);
    FOR(i,1,len)FOR(j,1,i)m[i][a[j]]=1;
    strcpy(b+1,a+1);
    if(len<26) {
        FOR(i,'a','z') {
            if(m[len][char(i)]==0) {
                a[len+1]=i;
                return 0*puts(a+1);
            }
        }
    }
    FIR(i,len-1,1) {
        b[i+1]=0;
        FOR(j,b[i]+1,'z') {
            if(m[i][char(j)]==0) {
                b[i]=j;
                return 0*puts(b+1);
            }
        }
    }
    puts("-1");
#ifndef out__   ///code end......
    ptc();
#endif
    return 0;
}
/**________________________main().end_________________________**/

/***************************************************************
**                                                            **
**  *********   *********   ********    **          ********* **
**      **      **          **     **   **          **        **
**      **      **          **     **   **          **        **
**      **      *********   ********    **          ********* **
**      **      **          **     **   **          **        **
**      **      **          **     **   **          **        **
**      **      *********   ********    *********   ********* **
**                                                            **
***************************************************************/


Measured memory_bytes: 256