
"""simple docstring"""

from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass






@dataclass
class 	_lowercase       :
	lowercase_				=     42
	lowercase_				=     42






class 	_lowercase       :




	def __init__(			self		,			UpperCAmelCase_ )		->							Union[str, Any]:
			lowerCamelCase					:      list[list[Edge]]          =   [[] for _ in range(UpperCAmelCase_ )]
			lowerCamelCase					:      Tuple          =   size




	def __getitem__(			self		,			UpperCAmelCase_ )		->							Iterator[Edge]:
			return iter(self._graph[vertex] )




	@property
	def       _UpperCamelCase   (			self )		->							Dict:
			return self._size




	def       _UpperCamelCase   (			self		,			UpperCAmelCase_		,			UpperCAmelCase_		,			UpperCAmelCase_ )		->							str:
			if weight not in (0, 1):
					raise ValueError('Edge weight must be either 0 or 1.' )

			if to_vertex < 0 or to_vertex >= self.size:
					raise ValueError('Vertex indexes must be in [0; size).' )

			self._graph[from_vertex].append(Edge(UpperCAmelCase_		,			UpperCAmelCase_ ) )




	def       _UpperCamelCase   (			self		,			UpperCAmelCase_		,			UpperCAmelCase_ )		->							int | None:
			lowerCamelCase					:      Dict          =   deque([start_vertex] )
			lowerCamelCase					:      list[int | None]          =   [None] * self.size
			lowerCamelCase					:      Dict          =   0

			while queue:
					lowerCamelCase					:      str          =   queue.popleft()
					lowerCamelCase					:      Tuple          =   distances[current_vertex]
					if current_distance is None:
							continue

					for edge in self[current_vertex]:
							lowerCamelCase					:      List[str]          =   current_distance + edge.weight
							lowerCamelCase					:      Optional[int]          =   distances[edge.destination_vertex]
							if (
							    isinstance(UpperCAmelCase_		,			UpperCAmelCase_ )
							    and new_distance >= dest_vertex_distance
							):
									continue
							lowerCamelCase					:      Any          =   new_distance
							if edge.weight == 0:
									queue.appendleft(edge.destination_vertex )
							else:
									queue.append(edge.destination_vertex )

			if distances[finish_vertex] is None:
					raise ValueError('No path from start_vertex to finish_vertex.' )

			return distances[finish_vertex]


if __name__ == "__main__":
					import doctest

					doctest.testmod()








"""simple docstring"""

def 		UpperCAmelCase (		a_ = 1000      ):





		'''simple docstring'''


		lowerCamelCase					:      Dict          =   2**power
		lowerCamelCase					:      List[str]          =   str(a_      )
		lowerCamelCase					:      Dict          =   list(a_      )
		lowerCamelCase					:      Optional[Any]          =   0

		for i in list_num:
				sum_of_num += int(a_      )

		return sum_of_num


if __name__ == "__main__":
					_A						=			int(input('Enter the power of 2: ').strip())
					print('2 ^ ', power, ' = ', 2**power)
					_A						=			solution(power)
					print('Sum of the digits is: ', result)






