"""simple docstring"""
def 						__a   (	_SCREAMING_SNAKE_CASE   )	->bool:
  a__:     set[int]										=	set()
  # To detect a back edge, keep track of vertices currently in the recursion stack
  a__:     set[int]										=	set()
  return any(
      node not in visited and depth_first_search(_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   )
      for node in graph   )







def 						__a   (	_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   )	->bool:
  visited.add(_SCREAMING_SNAKE_CASE   )
  rec_stk.add(_SCREAMING_SNAKE_CASE   )

  for node in graph[vertex]:
    if node not in visited:
      if depth_first_search(_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   ):
        return True
    elif node in rec_stk:
      return True

    # The node needs to be removed from recursion stack before function ends
  rec_stk.remove(_SCREAMING_SNAKE_CASE   )
  return False


if __name__ == "__main__":
 from doctest import testmod

 testmod()



"""simple docstring"""
def 						__a   (	_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   )	->Union[str, Any]:
  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		,     _SCREAMING_SNAKE_CASE   )	->Union[str, Any]:
  print('moving disk from'		,     _SCREAMING_SNAKE_CASE		,     'to'		,     _SCREAMING_SNAKE_CASE   )







def 						__a   (	)	->List[str]:
  a__:     Dict										=	int(input('Height of hanoi: '   ).strip()   )
  move_tower(_SCREAMING_SNAKE_CASE		,     'A'		,     'B'		,     'C'   )


if __name__ == "__main__":
 main()


