

import math







def 			A_      (    _UpperCAmelCase    ):

						if not isinstance(_UpperCAmelCase				,	_UpperCAmelCase    ):
												SCREAMING_SNAKE_CASE_: Any  		=       f"Input value of [number={number}] must be an integer"
												raise TypeError(_UpperCAmelCase    )

						if number < 1:
												SCREAMING_SNAKE_CASE_: Tuple  		=       f"Input value of [number={number}] must be > 0"
												raise ValueError(_UpperCAmelCase    )
						elif number == 1:
												return 3
						elif number == 2:
												return 5
						else:
												SCREAMING_SNAKE_CASE_: Dict  		=       int(math.log(number // 3				,	2    )    ) + 2

												SCREAMING_SNAKE_CASE_: Tuple  		=       [3, 5]
												SCREAMING_SNAKE_CASE_: int  		=       2
												SCREAMING_SNAKE_CASE_: int  		=       3
												for block in range(1				,	_UpperCAmelCase    ):
																		for _ in range(_UpperCAmelCase    ):
																								proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]    )
																								proth_index += 1
																		increment *= 2

						return proth_list[number - 1]


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						for number in range(11):
												lowerCAmelCase							:  List[str]   	=						0
												try:
																		lowerCAmelCase							:  List[str]   	=						proth(number)
												except ValueError:
																		print(f'''ValueError: there is no {number}th Proth number''')
																		continue

												print(f'''The {number}th Proth number: {value}''')









def 			A_      (    _UpperCAmelCase    ):
						SCREAMING_SNAKE_CASE_: List[str]  		=       [0] * len(_UpperCAmelCase    )
						SCREAMING_SNAKE_CASE_: List[Any]  		=       []
						SCREAMING_SNAKE_CASE_: str  		=       []
						SCREAMING_SNAKE_CASE_: List[str]  		=       0

						for values in graph.values():
												for i in values:
																		indegree[i] += 1

						for i in range(len(_UpperCAmelCase    )    ):
												if indegree[i] == 0:
																		queue.append(_UpperCAmelCase    )

						while queue:
												SCREAMING_SNAKE_CASE_: Optional[int]  		=       queue.pop(0    )
												cnt += 1
												topo.append(_UpperCAmelCase    )
												for x in graph[vertex]:
																		indegree[x] -= 1
																		if indegree[x] == 0:
																								queue.append(_UpperCAmelCase    )

						if cnt != len(_UpperCAmelCase    ):
												print("Cycle exists"    )
						else:
												print(_UpperCAmelCase    )


# Adjacency List of Graph
lowerCAmelCase							:  Any   	=						{0: [1, 2], 1: [3], 2: [3], 3: [4, 5], 4: [], 5: []}



topological_sort(graph)






