"""simple docstring"""







from __future__ import annotations

from queue import Queue


class      _lowercase						:

				def __init__(       self    :      str       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						{}

				def     A	(       self    :      Any       ):


										'''simple docstring'''
										for i in self.vertices:
																print(_lowercase    ,      """ : """    ,      """ -> """.join([str(_lowercase       ) for j in self.vertices[i]]       )       )

				def     A	(       self    :      Any    ,      _lowercase    :      int    ,      _lowercase    :      int       ):


										'''simple docstring'''
										if from_vertex in self.vertices:
																self.vertices[from_vertex].append(_lowercase       )
										else:
																UpperCAmelCase__   		=						[to_vertex]

				def     A	(       self    :      Optional[int]    ,      _lowercase    :      int       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						set()

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

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

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


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

						testmod(verbose=True)

						UpperCamelCase_    :    Any											=						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 					a__ (						UpperCAmelCase__    :     List[Any]     )->		Dict:
						UpperCAmelCase__   		=						[7_0_1, 3_0_1, 1_3_2, 5_7, 2_3, 1_0, 4, 1]
						for gap in gaps:
												for i in range(UpperCAmelCase__						,     len(UpperCAmelCase__     )     ):
																		UpperCAmelCase__   		=						collection[i]
																		UpperCAmelCase__   		=						i
																		while j >= gap and collection[j - gap] > insert_value:
																								UpperCAmelCase__   		=						collection[j - gap]
																								j -= gap
																		if j != i:
																								UpperCAmelCase__   		=						insert_value
						return collection


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

						testmod()
						UpperCamelCase_    :    Union[str, Any]											=						input("""Enter numbers separated by a comma:\n""").strip()
						UpperCamelCase_    :    int											=						[int(item) for item in user_input.split(""",""")]
						print(shell_sort(unsorted))

