"""simple docstring"""
lowercase__					       =	{
    'A': ['B', 'C', 'E'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F', 'G'],
    'D': ['B'],
    'E': ['A', 'B', 'D'],
    'F': ['C'],
    'G': ['C'],
}







def 						__a   (	_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   )	->list[str]:
  a__:     Dict										=	set()
  # keep track of all the paths to be checked
  a__:     str										=	[[start]]

  # return path if start is goal
  if start == goal:
    return [start]

  # keeps looping until all possible paths have been checked
  while queue:
    # pop the first path from the queue
    a__:     int										=	queue.pop(0   )
    # get the last node from the path
    a__:     List[str]										=	path[-1]
    if node not in explored:
      a__:     Tuple										=	graph[node]
      # go through all neighbour nodes, construct a new path and
      # push it into the queue
      for neighbour in neighbours:
        a__:     Dict										=	list(_SCREAMING_SNAKE_CASE   )
        new_path.append(_SCREAMING_SNAKE_CASE   )
        queue.append(_SCREAMING_SNAKE_CASE   )
        # return path if neighbour is goal
        if neighbour == goal:
          return new_path

            # mark node as explored
      explored.add(_SCREAMING_SNAKE_CASE   )

    # in case there's no path between the 2 nodes
  return []







def 						__a   (	_SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE		,     _SCREAMING_SNAKE_CASE   )	->int:
  if not graph or start not in graph or target not in graph:
    return -1
  if start == target:
    return 0
  a__:     Optional[int]										=	[start]
  a__:     Union[str, Any]										=	set(_SCREAMING_SNAKE_CASE   )
  # Keep tab on distances from `start` node.
  a__:     List[str]										=	{start: 0, target: -1}
  while queue:
    a__:     List[str]										=	queue.pop(0   )
    if node == target:
      a__:     Union[str, Any]										=	(
          dist[node] if dist[target] == -1 else min(dist[target]		,     dist[node]   )
      )
    for adjacent in graph[node]:
      if adjacent not in visited:
        visited.add(_SCREAMING_SNAKE_CASE   )
        queue.append(_SCREAMING_SNAKE_CASE   )
        a__:     str										=	dist[node] + 1
  return dist[target]


if __name__ == "__main__":
 print(bfs_shortest_path(demo_graph, 'G', 'D'))  # returns ['G', 'C', 'A', 'B', 'D']
 print(bfs_shortest_path_distance(demo_graph, 'G', 'D'))  # returns 4



"""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()


