#include<bits/stdc++.h>
using namespace std;
int a[127],l=1,i;
char s[27],c;
int main(){
  cin>>s;
  for(i=0;s[i]!='\0';i++)a[s[i]]=1,l++;
  for(c='z';c>='a';c--)if(!a[c])s[l++]=c;
  cout<<(next_permutation(s,s+l)?s:"-1")<<endl;
}
