


'''simple docstring'''



from __future__ import annotations







def       _UpperCamelCase (						UpperCamelCase__	, UpperCamelCase__   ):
			UpperCAmelCase__				,    UpperCAmelCase__					:   str       				=       set(UpperCamelCase__   ), [start]

			while stack:
						UpperCAmelCase__					:   str       				=       stack.pop()
						explored.add(UpperCamelCase__   )
						# Differences from BFS:
						# 1) pop last element instead of first one
						# 2) add adjacent elements to stack without exploring them
						for adj in reversed(graph[v]   ):
									if adj not in explored:
												stack.append(UpperCamelCase__   )
			return explored


__A		={
    'A': ['B', 'C', 'D'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B', 'D'],
    'E': ['B', 'F'],
    'F': ['C', 'E', 'G'],
    'G': ['F'],
}

if __name__ == "__main__":
		import doctest

		doctest.testmod()
		print(depth_first_search(G, 'A'))



'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__ = 1_0	, UpperCamelCase__ = 2_2   ):
			UpperCAmelCase__					:   List[str]       				=       range(1	, UpperCamelCase__   )
			UpperCAmelCase__					:   int       				=       range(1	, UpperCamelCase__   )
			return sum(
			    1 for power in powers for base in bases if len(str(base**power   )   ) == power   )


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