
'''simple docstring'''







import math
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int							):



						"""simple docstring"""





						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or number % 2 == 0 or number % 3 == 0:
												# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
												return False

						# All primes number are in format of 6k +/- 1
						for i in range(5   ,   int(math.sqrt(__SCREAMING_SNAKE_CASE							) + 1							)   ,   6							):
												if number % i == 0 or number % (i + 2) == 0:
																		return False
						return True
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 600851475143							):



						"""simple docstring"""





						try:
												lowercase_			:  List[str]									= int(__SCREAMING_SNAKE_CASE							)
						except (TypeError, ValueError):
												raise TypeError('''Parameter n must be int or castable to int.'''							)
						if n <= 0:
												raise ValueError('''Parameter n must be greater than or equal to one.'''							)
						lowercase_			:  Tuple									= 0
						if is_prime(__SCREAMING_SNAKE_CASE							):
												return n
						while n % 2 == 0:
												n //= 2
						if is_prime(__SCREAMING_SNAKE_CASE							):
												return n
						for i in range(3   ,   int(math.sqrt(__SCREAMING_SNAKE_CASE							)							) + 1   ,   2							):
												if n % i == 0:
																		if is_prime(n // i							):
																								lowercase_			:  str									= n // i
																								break
																		elif is_prime(__SCREAMING_SNAKE_CASE							):
																								lowercase_			:  Optional[Any]									= i
						return max_number


if __name__ == "__main__":
							print(f"""{solution() = }""")





'''simple docstring'''







from __future__ import annotations

from queue import Queue






class 				lowerCAmelCase__     :






					def __init__(     self	):


											"""simple docstring"""





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






					def 			_snake_case					(     self	):


											"""simple docstring"""





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






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											if from_vertex in self.vertices:
																	self.vertices[from_vertex].append(__SCREAMING_SNAKE_CASE	)
											else:
																	lowercase_			:  Optional[Any]									= [to_vertex]






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= set()

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

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

											while not queue.empty():
																	lowercase_			:  List[Any]									= 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(__SCREAMING_SNAKE_CASE	)
																													visited.add(__SCREAMING_SNAKE_CASE	)
											return visited


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

							testmod(verbose=True)

							_lowercase				:						Optional[int]												= 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]



