import std.stdio,
       std.string,
       std.conv,
       std.algorithm;

void main() {
  string S = readln.chomp;
  int[char] arr;

  foreach (c; 'a'..'z') {
    arr[c] = 0;
  }

  foreach (c; S) {
    arr[c]++;
  }

  char add_char = 'z' + 1;
  foreach (c; arr.byKey) {
    if (arr[c] != 0) continue;
    if (S < S ~ c) {
      add_char = min(add_char, c);
    }
  }

  if (add_char != 'z' + 1) {
    writeln(S ~ add_char);
    return;
  }

  char min_char = S[S.length - 1];
  char poi = 'z' + 1;
  for (long i = cast(long)(S.length - 2); i >= 0; i--) {
    if (min_char > S[i]) {
      writeln(S[0..i] ~ min_char);
      return;
    }
  }

  writeln(-1);
}
