use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

chomp (my $s = <STDIN>);
my $m = length $s;
my @t = split //, $s;
my @u = sort {$a cmp $b} grep {my $x = 0; for my $i (0..$m-1) {$x++ if $_ eq $t[$i]}; $x} ('a'..'z');
if (@u < 26) {
  for my $i ('a'..'z') {
    my $f = 0;
    for my $j (0..@u-1) {
      if ($u[$j] eq $i) {
        last;
      }
      $f = 1;
    }
    if ($f==1) {
      say $s.$i;
      exit;
    }
  }
} else {
  my $f = -1;
  for my $i (0..24) {
    if ($t[$i] gt $t[$i+1]) {
      $f = $i;
      last;
    }
  }
  if ($f==-1) {
    say -1;
  } else {
    my $w = substr($s, $f-1, 1);
    my @x = ('a'..'z');
    for my $i (0..25) {
      if ($x[$i] eq $w) {
        $w = $x[$i+1];
        last;
      } 
    }
    say substr($s, 0, $f-1).$w
  }
}