
'''simple docstring'''





from __future__ import annotations

from queue import Queue






class        UpperCAmelCase_       :

 '''simple docstring'''







 def __init__(				self		:     int   ):



   '''simple docstring'''




   UpperCAmelCase__			:				dict[int, list[int]]												=       {}







 def        UpperCamelCase     (				self		:     Optional[int]   ):



   '''simple docstring'''




   for i in self.vertices:
     print(snake_case__ ,							" : " ,							" -> ".join([str(snake_case__   ) for j in self.vertices[i]]   )   )







 def        UpperCamelCase     (				self		:     List[str] ,							snake_case__		:     int ,							snake_case__		:     int   ):



   '''simple docstring'''




   if from_vertex in self.vertices:
     self.vertices[from_vertex].append(snake_case__   )
   else:
     UpperCAmelCase__			:				List[Any]												=       [to_vertex]







 def        UpperCamelCase     (				self		:     Optional[int] ,							snake_case__		:     int   ):



   '''simple docstring'''




   UpperCAmelCase__			:				List[str]												=       set()

   # create a first in first out queue to store all the vertices for BFS
   UpperCAmelCase__			:				Queue												=       Queue()

   # mark the source node as visited and enqueue it
   visited.add(snake_case__   )
   queue.put(snake_case__   )

   while not queue.empty():
     UpperCAmelCase__			:				Dict												=       queue.get()

     # loop through all adjacent vertex and enqueue it if not yet visited
     for adjacent_vertex in self.vertices[vertex]:
       if adjacent_vertex not in visited:
         queue.put(snake_case__   )
         visited.add(snake_case__   )
   return visited


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

      testmod(verbose=True)

      SCREAMING_SNAKE_CASE    =					Graph()
      g.add_edge(0, 1)
      g.add_edge(0, 2)
      g.add_edge(1, 2)
      g.add_edge(2, 0)
      g.add_edge(2, 3)
      g.add_edge(3, 3)

      g.print_graph()
      # 0  :  1 -> 2
      # 1  :  2
      # 2  :  0 -> 3
      # 3  :  3

      assert sorted(g.bfs(2)) == [0, 1, 2, 3]





'''simple docstring'''





def snake_case_    (				lowercase__      ,					lowercase__ = 1_3		):
  UpperCAmelCase__			:				Optional[Any]												=       ""
  for c in s:
    if "A" <= c <= "Z":
      out += chr(ord("A"		) + (ord(lowercase__		) - ord("A"		) + n) % 2_6		)
    elif "a" <= c <= "z":
      out += chr(ord("a"		) + (ord(lowercase__		) - ord("a"		) + n) % 2_6		)
    else:
      out += c
  return out







def snake_case_    (				):
  UpperCAmelCase__			:				Dict												=       input("Enter message: "		)

  UpperCAmelCase__			:				Optional[int]												=       dencrypt(lowercase__      ,					1_3		)
  print("Encryption:"      ,					lowercase__		)

  UpperCAmelCase__			:				Union[str, Any]												=       dencrypt(lowercase__      ,					1_3		)
  print("Decryption: "      ,					lowercase__		)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()



