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;
    add_char = min(add_char, c);
  }

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

  char min_char = 'z' + 1;
  bool f = false;
  for (long i = S.length - 2; i != ulong.max; i--) {
    for (long j = i + 1; j < S.length; j++) {
      if (S[j] > S[i]) {
        min_char = min(min_char, S[j]);
        f = true;
      }
    }
    if (f) {
      writeln(S[0..i] ~ min_char);
      return;
    }
  }

  writeln(-1);
}
