#include <bits/stdc++.h>

using namespace std;

int main()
{
  string s;
  cin>>s;
  string t=s;
  set<char>A;
  for(auto x:s)A.insert(x);
  for(int i=s.size();i>=0;i--)
  {
    for(int j=(i==s.size()?0:(s[i]-'a'));j+'a'<='z';j++)
    {
      if(A.count(j+'a')!=0)continue;
      s+=(j+'a');
      if(t>=s)
      {
        s.pop_back();
        continue;
      }
      cout<<s<<endl;
      return 0;
    }
    if(i>0)
    {
      A.erase(s[i-1]);
      s.pop_back();
    }
  }
  cout<<-1<<endl;
  return 0;
}