

from __future__ import annotations

from queue import Queue





class       __UpperCAmelCase  :



   def __init__(							self							:  Tuple		):
     UpperCAmelCase :							dict[int, list[int]]								=				{}



   def  __magic_name__					(							self							:  Union[str, Any]		):
     for i in self.vertices:
       print(__A,	''' : ''',	''' -> '''.join([str(__A		) for j in self.vertices[i]]		)		)



   def  __magic_name__					(							self							:  Union[str, Any],	__A							:  int,	__A							:  int		):
     if from_vertex in self.vertices:
       self.vertices[from_vertex].append(__A		)
     else:
       UpperCAmelCase :							Union[str, Any]								=				[to_vertex]





   def  __magic_name__					(							self							:  Optional[Any],	__A							:  int		):
     UpperCAmelCase :							Union[str, Any]								=				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(__A		)
     queue.put(__A		)

     while not queue.empty():
       UpperCAmelCase :							int								=				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(__A		)
           visited.add(__A		)
     return visited


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

     testmod(verbose=True)

     _lowerCamelCase       :     Tuple           =							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]








import decimal

def     a__  (	)						->		int:
  UpperCAmelCase :							List[Any]								=				0
  UpperCAmelCase :							Dict								=				decimal.Context(prec=105    )
  for i in range(2       ,				100    ):
    UpperCAmelCase :							List[str]								=				decimal.Decimal(UpperCAmelCase    )
    UpperCAmelCase :							List[str]								=				number.sqrt(UpperCAmelCase    )
    if len(str(UpperCAmelCase    )    ) > 1:
      answer += int(str(UpperCAmelCase    )[0]    )
      UpperCAmelCase :							str								=				str(UpperCAmelCase    )[2:101]
      answer += sum(int(UpperCAmelCase    ) for x in sqrt_number_str    )
  return answer


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(f"""{solution() = }""")





