





def 			_a		(       UpperCAmelCase     ,    UpperCAmelCase     ,    UpperCAmelCase	)							->							int:







   """simple docstring"""

   if exponent == 1:
      return base
   if exponent % 2 == 0:
      lowerCamelCase__  :		Any     =				_modexpt(__a     ,    exponent // 2     ,    __a	) % modulo_value
      return (x * x) % modulo_value
   else:
      return (base * _modexpt(__a     ,    exponent - 1     ,    __a	)) % modulo_value



def 			_a		(       UpperCAmelCase = 1777     ,    UpperCAmelCase = 1855     ,    UpperCAmelCase = 8	)							->							int:







   """simple docstring"""
   lowerCamelCase__  :		List[str]     =				base
   for _ in range(1     ,    __a	):
      lowerCamelCase__  :		Optional[Any]     =				_modexpt(__a     ,    __a     ,    10**digits	)

   return result


if __name__ == "__main__":
       print(F'''{solution() = }''')










class     A     :
			'''simple docstring'''




			def __init__(     self  :       Optional[int]  )      ->      Dict:







					"""simple docstring"""






					A__     =  {}






			def   a_			(     self  :       Any  )      ->      None:







					"""simple docstring"""






					print(self.vertex  )
					for i in self.vertex:
							print(__lowerCAmelCase				,      """ -> """				,      """ -> """.join([str(__lowerCAmelCase  ) for j in self.vertex[i]]  )  )






			def   a_			(     self  :       Optional[int]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       int  )      ->      None:







					"""simple docstring"""






					if from_vertex in self.vertex:
							self.vertex[from_vertex].append(__lowerCAmelCase  )
					else:
							# else make a new vertex
							A__     =  [to_vertex]






			def   a_			(     self  :       List[str]  )      ->      None:







					"""simple docstring"""






					A__     =  [False] * len(self.vertex  )

					# call the recursive helper function
					for i in range(len(self.vertex  )  ):
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )







			def   a_			(     self  :       List[str]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       list  )      ->      None:







					"""simple docstring"""






					A__     =  True

					print(__lowerCAmelCase				,      end=""" """  )

					# Recur for all the vertices that are adjacent to this node
					for i in self.vertex:
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )


if __name__ == "__main__":
					A       :   Tuple					= 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()
					print('''DFS:''')
					g.dfs()

					# OUTPUT:
					# 0  ->  1 -> 2
					# 1  ->  2
					# 2  ->  0 -> 3
					# 3  ->  3
					# DFS:
					#  0 1 2 3



