import math







def  __lowerCAmelCase							(						__SCREAMING_SNAKE_CASE    : int					):







    '''simple docstring'''
    if n <= 0:
        raise ValueError("""Only positive integers have prime factors"""					)
    __snake_case    :							Union[str, Any]             =  []
    while n % 2 == 0:
        pf.append(2					)
        __snake_case    :							Tuple             =  int(n / 2					)
    for i in range(3						,				int(math.sqrt(__SCREAMING_SNAKE_CASE					)					) + 1						,				2					):
        while n % i == 0:
            pf.append(__SCREAMING_SNAKE_CASE					)
            __snake_case    :							Optional[int]             =  int(n / i					)
    if n > 2:
        pf.append(__SCREAMING_SNAKE_CASE					)
    return pf







def  __lowerCAmelCase							(						__SCREAMING_SNAKE_CASE    : int					):







    '''simple docstring'''
    if n <= 0:
        raise ValueError("""Only positive numbers are accepted"""					)
    __snake_case    :							Dict             =  1
    __snake_case    :							str             =  1
    while n % 2 == 0:
        temp += 1
        __snake_case    :							List[str]             =  int(n / 2					)
    div *= temp
    for i in range(3						,				int(math.sqrt(__SCREAMING_SNAKE_CASE					)					) + 1						,				2					):
        __snake_case    :							Any             =  1
        while n % i == 0:
            temp += 1
            __snake_case    :							Any             =  int(n / i					)
        div *= temp
    if n > 1:
        div *= 2
    return div







def  __lowerCAmelCase							(						__SCREAMING_SNAKE_CASE    : int					):







    '''simple docstring'''
    if n <= 0:
        raise ValueError("""Only positive numbers are accepted"""					)
    __snake_case    :							Optional[Any]             =  1
    __snake_case    :							Union[str, Any]             =  1
    while n % 2 == 0:
        temp += 1
        __snake_case    :							Optional[Any]             =  int(n / 2					)
    if temp > 1:
        s *= (2**temp - 1) / (2 - 1)
    for i in range(3						,				int(math.sqrt(__SCREAMING_SNAKE_CASE					)					) + 1						,				2					):
        __snake_case    :							List[str]             =  1
        while n % i == 0:
            temp += 1
            __snake_case    :							List[Any]             =  int(n / i					)
        if temp > 1:
            s *= (i**temp - 1) / (i - 1)
    return int(__SCREAMING_SNAKE_CASE					)







def  __lowerCAmelCase							(						__SCREAMING_SNAKE_CASE    : int					):







    '''simple docstring'''
    __snake_case    :							Any             =  n
    for x in set(prime_factors(__SCREAMING_SNAKE_CASE					)					):
        s *= (x - 1) / x
    return int(__SCREAMING_SNAKE_CASE					)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






from __future__ import annotations

class  a     :


						def __init__(				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						List[Any]       						=			vertices
										_UpperCAmelCase				:						List[str]       						=			[[0] * vertices for _ in range(A_		)]


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										print("Vertex \t Distance from Source"		)
										for vertex in range(self.vertices		):
														print(A_  ,    "\t\t"  ,    distances_from_source[vertex]		)


						def 				_UpperCAmelCase (				self  ,    A_  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Tuple       						=			1e7
										_UpperCAmelCase				:						Any       						=			0

										# Search not nearest vertex not in the shortest path tree
										for vertex in range(self.vertices		):
														if distances_from_source[vertex] < minimum and visited[vertex] is False:
																		_UpperCAmelCase				:						List[Any]       						=			distances_from_source[vertex]
																		_UpperCAmelCase				:						Tuple       						=			vertex
										return min_index





						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			[int(1e7		)] * self.vertices  # distances from the source
										_UpperCAmelCase				:						Optional[Any]       						=			0
										_UpperCAmelCase				:						List[str]       						=			[False] * self.vertices

										for _ in range(self.vertices		):
														_UpperCAmelCase				:						str       						=			self.minimum_distance(A_  ,    A_		)
														_UpperCAmelCase				:						str       						=			True

														# Update dist value of the adjacent vertices
														# of the picked vertex only if the current
														# distance is greater than new distance and
														# the vertex in not in the shortest path tree
														for v in range(self.vertices		):
																		if (
																		    self.graph[u][v] > 0
																		    and visited[v] is False
																		    and distances[v] > distances[u] + self.graph[u][v]
																		):
																						_UpperCAmelCase				:						str       						=			distances[u] + self.graph[u][v]

										self.print_solution(A_		)


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE_						=					Graph(9)
					SCREAMING_SNAKE_CASE_						=					[
					    [0, 4, 0, 0, 0, 0, 0, 8, 0],
					    [4, 0, 8, 0, 0, 0, 0, 11, 0],
					    [0, 8, 0, 7, 0, 4, 0, 0, 2],
					    [0, 0, 7, 0, 9, 14, 0, 0, 0],
					    [0, 0, 0, 9, 0, 10, 0, 0, 0],
					    [0, 0, 4, 14, 10, 0, 2, 0, 0],
					    [0, 0, 0, 0, 0, 2, 0, 1, 6],
					    [8, 11, 0, 0, 0, 0, 1, 0, 7],
					    [0, 0, 2, 0, 0, 0, 6, 7, 0],
					]
					graph.dijkstra(0)


