





def   __lowerCamelCase   (				__a  :str       ,	__a  :str       )						->							str:






		"""simple docstring"""

		if not (isinstance(__a       ,	__a       ) and isinstance(__a       ,	__a       )):
				raise ValueError("""longest_common_substring() takes two strings for inputs"""       )

		A__     =  len(__a       )
		A__     =  len(__a       )

		A__     =  [[0] * (texta_length + 1) for _ in range(texta_length + 1       )]
		A__     =  0
		A__     =  0

		for i in range(1       ,	texta_length + 1       ):
				for j in range(1       ,	texta_length + 1       ):
						if texta[i - 1] == texta[j - 1]:
								A__     =  1 + dp[i - 1][j - 1]
								if dp[i][j] > ans_length:
										A__     =  i
										A__     =  dp[i][j]

		return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
					import doctest

					doctest.testmod()










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



