output_description: Print the next word that appears after S in the dictionary, or `-1` if it
  doesn't exist.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: s = list(input())
  for i in range(len(s)):
      if s[i] == "a":
          s[i] = 0
      if s[i] == "b":
          s[i] = 1
      if s[i] == "c":
          s[i] = 2
      if s[i] == "d":
          s[i] = 3
      if s[i] == "e":
          s[i] = 4
      if s[i] == "f":
          s[i] = 5
      if s[i] == "g":
          s[i] = 6
      if s[i] == "h":
          s[i] = 7
      if s[i] == "i":
          s[i] = 8
      if s[i] == "j":
          s[i] = 9
      if s[i] == "k":
          s[i] = 10
      if s[i] == "l":
          s[i] = 11
      if s[i] == "m":
          s[i] = 12
      if s[i] == "n":
          s[i] = 13
      if s[i] == "o":
          s[i] = 14
      if s[i] == "p":
          s[i] = 15
      if s[i] == "q":
          s[i] = 16
      if s[i] == "r":
          s[i] = 17
      if s[i] == "s":
          s[i] = 18
      if s[i] == "t":
          s[i] = 19
      if s[i] == "u":
          s[i] = 20
      if s[i] == "v":
          s[i] = 21
      if s[i] == "w":
          s[i] = 22
      if s[i] == "x":
          s[i] = 23
      if s[i] == "y":
          s[i] = 24
      if s[i] == "z":
          s[i] = 25
  if len(s) != 26:
      for i in range(26):
          if i not in s:
              s.append(i)
              break
      for i in range(len(s)):
          if s[i] == 0:
              s[i] = "a"
          if s[i] == 1:
              s[i] = "b"
          if s[i] == 2:
              s[i] = "c"
          if s[i] == 3:
              s[i] = "d"
          if s[i] == 4:
              s[i] = "e"
          if s[i] == 5:
              s[i] = "f"
          if s[i] == 6:
              s[i] = "g"
          if s[i] == 7:
              s[i] = "h"
          if s[i] == 8:
              s[i] = "i"
          if s[i] == 9:
              s[i] = "j"
          if s[i] == 10:
              s[i] = "k"
          if s[i] == 11:
              s[i] = "l"
          if s[i] == 12:
              s[i] = "m"
          if s[i] == 13:
              s[i] = "n"
          if s[i] == 14:
              s[i] = "o"
          if s[i] == 15:
              s[i] = "p"
          if s[i] == 16:
              s[i] = "q"
          if s[i] == 17:
              s[i] = "r"
          if s[i] == 18:
              s[i] = "s"
          if s[i] == 19:
              s[i] = "t"
          if s[i] == 20:
              s[i] = "u"
          if s[i] == 21:
              s[i] = "v"
          if s[i] == 22:
              s[i] = "w"
          if s[i] == 23:
              s[i] = "x"
          if s[i] == 24:
              s[i] = "y"
          if s[i] == 25:
              s[i] = "z"
      s_ = "".join(s)
      print(s_)
  else:
      x = 1
      while True:
          if s[-x] > s[-x - 1]:
              s1 = s[0 : -x - 1]
              s2 = s[-x - 1] + 1
              s1.append(s2)
              break
          else:
              x = x + 1
              if x == 26:
                  break
      if s == [
          25,
          24,
          23,
          22,
          21,
          20,
          19,
          18,
          17,
          16,
          15,
          14,
          13,
          12,
          11,
          10,
          9,
          8,
          7,
          6,
          5,
          4,
          3,
          2,
          1,
          0,
      ]:
          print("-1")
      else:
          for i in range(len(s1)):
              if s1[i] == 0:
                  s1[i] = "a"
              if s1[i] == 1:
                  s1[i] = "b"
              if s1[i] == 2:
                  s1[i] = "c"
              if s1[i] == 3:
                  s1[i] = "d"
              if s1[i] == 4:
                  s1[i] = "e"
              if s1[i] == 5:
                  s1[i] = "f"
              if s1[i] == 6:
                  s1[i] = "g"
              if s1[i] == 7:
                  s1[i] = "h"
              if s1[i] == 8:
                  s1[i] = "i"
              if s1[i] == 9:
                  s1[i] = "j"
              if s1[i] == 10:
                  s1[i] = "k"
              if s1[i] == 11:
                  s1[i] = "l"
              if s1[i] == 12:
                  s1[i] = "m"
              if s1[i] == 13:
                  s1[i] = "n"
              if s1[i] == 14:
                  s1[i] = "o"
              if s1[i] == 15:
                  s1[i] = "p"
              if s1[i] == 16:
                  s1[i] = "q"
              if s1[i] == 17:
                  s1[i] = "r"
              if s1[i] == 18:
                  s1[i] = "s"
              if s1[i] == 19:
                  s1[i] = "t"
              if s1[i] == 20:
                  s1[i] = "u"
              if s1[i] == 21:
                  s1[i] = "v"
              if s1[i] == 22:
                  s1[i] = "w"
              if s1[i] == 23:
                  s1[i] = "x"
              if s1[i] == 24:
                  s1[i] = "y"
              if s1[i] == 25:
                  s1[i] = "z"
          s2_ = "".join(s1)
          print(s2_)
  
problem_description: Statement
  
  Gotou just received a dictionary. However, he doesn't recognize the language
  used in the dictionary. He did some analysis on the dictionary and realizes
  that the dictionary contains all possible **diverse** words in lexicographical
  order.
  
  A word is called **diverse** if and only if it is a nonempty string of English
  lowercase letters and all letters in the word are distinct. For example,
  `atcoder`, `zscoder` and `agc` are diverse words while `gotou` and `connect`
  aren't diverse words.
  
  Given a diverse word S, determine the next word that appears after S in the
  dictionary, i.e. the lexicographically smallest diverse word that is
  lexicographically larger than S, or determine that it doesn't exist.
  
  Let X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings.
  X is lexicographically larger than Y if and only if Y is a prefix of X or
  x_{j} > y_{j} where j is the smallest integer such that x_{j} \neq y_{j}.
samples: [{"input": "atcoder", "output": "atcoderb\n    \n\n`atcoderb` is the lexicographically smallest diverse word that is\nlexicographically larger than `atcoder`. Note that `atcoderb` is\nlexicographically smaller than `b`.\n\n* * *"}, {"input": "abc", "output": "abcd\n    \n\n* * *"}, {"input": "zyxwvutsrqponmlkjihgfedcba", "output": "-1\n    \n\nThis is the lexicographically largest diverse word, so the answer is `-1`.\n\n* * *"}, {"input": "abcdefghijklmnopqrstuvwzyx", "output": "abcdefghijklmnopqrstuvx"}]