


"""simple docstring"""







def 					a__			(				SCREAMING_SNAKE_CASE    :    str				):


  '''simple docstring'''







  lowerCAmelCase     :     Union[str, Any]								=							[0] * len(SCREAMING_SNAKE_CASE				)

  for i in range(1				,      len(SCREAMING_SNAKE_CASE				)				):
    # use last results for better performance - dynamic programming
    lowerCAmelCase     :     Union[str, Any]								=							prefix_result[i - 1]
    while j > 0 and input_string[i] != input_string[j]:
      lowerCAmelCase     :     str								=							prefix_result[j - 1]

    if input_string[i] == input_string[j]:
      j += 1
    lowerCAmelCase     :     List[Any]								=							j

  return prefix_result
def 					a__			(				SCREAMING_SNAKE_CASE    :    str				):


  '''simple docstring'''







  return max(prefix_function(SCREAMING_SNAKE_CASE				)				)


if __name__ == "__main__":
     import doctest

     doctest.testmod()









"""simple docstring"""







def 					a__			(				SCREAMING_SNAKE_CASE    :    int				,      SCREAMING_SNAKE_CASE    :    List[Any]				,      SCREAMING_SNAKE_CASE    :    str				,      SCREAMING_SNAKE_CASE    :    List[Any]				):


  '''simple docstring'''







  if height >= 1:
    move_tower(height - 1				,      SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				)
    move_disk(SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				)
    move_tower(height - 1				,      SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				,      SCREAMING_SNAKE_CASE				)
def 					a__			(				SCREAMING_SNAKE_CASE    :    Tuple				,      SCREAMING_SNAKE_CASE    :    Optional[int]				):


  '''simple docstring'''







  print("moving disk from"				,      SCREAMING_SNAKE_CASE				,      "to"				,      SCREAMING_SNAKE_CASE				)
def 					a__			(				):


  '''simple docstring'''







  lowerCAmelCase     :     Optional[int]								=							int(input("Height of hanoi: "				).strip()				)
  move_tower(SCREAMING_SNAKE_CASE				,      "A"				,      "B"				,      "C"				)


if __name__ == "__main__":
     main()





