#include <iostream>
#include <string>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool a[256] = {};
  for (char c : s) {
  	a[c] = true;
  }
  for (char c = 'a'; c <= 'z'; c++) {
    if (!a[c]) {
      cout << s << c << endl;
      return 0;
    }
  }
  while (!s.empty()) {
    char sb = s.back();
    a[sb] = false;
    s.pop_back();
    for (char c = sb + 1; c <= 'z'; c++) {
      if (!a[c]) {
        cout << s << c << endl;
        return 0;
      }
    }
  }
  cout << -1 << endl;
}
